you said that we can choose numbers from any vector blue or red to make 1 to n. But this logic will fail in a case: 2 1 1 RB here, red=1 and blue = 1 in blue and red vector.......if we choose first number from red vector your logic will fail...we must have to choose from blue vector to get ac........isn't it?
@@yash.dwivedi he said that we can choose numbers from any vector blue or red to make 1 to n. But this logic will fail in a case: 2 1 1 RB here, red=1 and blue = 1 in blue and red vector.......if we choose first number from red vector your logic will fail...we must have to choose from blue vector to get ac........isn't it?
Excellent explanation, I was searching for hrs, Glad I finally found urs..Keep up the good work
Thanks Rajat we will bring more quality videos in future stay tuned!!
Thanks for the video 🙏🙏.
you said that we can choose numbers from any vector blue or red to make 1 to n. But this logic will fail in a case:
2
1 1
RB
here, red=1 and blue = 1 in blue and red vector.......if we choose first number from red vector your logic will fail...we must have to choose from blue vector to get ac........isn't it?
sir ye
In case of blue we need to check if the i-th blue number is less than
@@yash.dwivedi he said that we can choose numbers from any vector blue or red to make 1 to n. But this logic will fail in a case:
2
1 1
RB
here, red=1 and blue = 1 in blue and red vector.......if we choose first number from red vector your logic will fail...we must have to choose from blue vector to get ac........isn't it?