This is really one of the most underrated video on TH-cam. The way you have explained this concept is awesome. Please do continue this good work. Everyone can be a good programmer/coder but everyone can't be a good teacher.
I just started learning DSA when i am unable to solve leet code problem i first search in your youtube channel for a solution, In my opinion you are best at explain algorithms, Keep on going .
I watched two explanations before this but couldn’t understand them. However, your teaching method was awesome, and I was able to write the code on my own right after understanding your solution. Thank you!
What happens if the first and the last index both exists in left bound? or right bound? this approach will return last index or first index as -1 right?
Let’s say both first and last exist in the left bound. When you first divide the array, you will not find the element in the middle, so following a binary search algorithm you will look in the left half. This will be your new array now. So you will again find the first and last index in the left half. Try out a test case on your own and you will understand it better :)
This is really one of the most underrated video on TH-cam. The way you have explained this concept is awesome. Please do continue this good work. Everyone can be a good programmer/coder but everyone can't be a good teacher.
Thanks for all the love and support
I just started learning DSA when i am unable to solve leet code problem i first search in your youtube channel for a solution, In my opinion you are best at explain algorithms, Keep on going .
I watched two explanations before this but couldn’t understand them. However, your teaching method was awesome, and I was able to write the code on my own right after understanding your solution. Thank you!
the best , easy and good approach for the problem thanku so much nikhil for this
the way of teaching makes us to solve the more problems
love it
Fantastic and clear explanation. Thank you!
You're very welcome!
u explain everything and it was quite easy to understand, thankyouuu
It was super smooth and easy to understand. Thanks 👍
The way you make things clear is superr
The way of your explanation excellent 👏👏👏
Great Explanation👏👏👏
please upload more dsa question.. i only want to learn from you
Thank you sir ❤
brilliant🤩
Will this solution work if input is [1,2,3] and target is 2
What happens if the first and the last index both exists in left bound? or right bound? this approach will return last index or first index as -1 right?
Let’s say both first and last exist in the left bound.
When you first divide the array, you will not find the element in the middle, so following a binary search algorithm you will look in the left half. This will be your new array now.
So you will again find the first and last index in the left half.
Try out a test case on your own and you will understand it better :)
@@nikoo28 Kind of recursive
Yes indeed…this is a recursive solution. Just like binary search.
@@nikoo28 thank you
@@nikoo28 when low < high breaks the loop and the low value = 3 but the index value is still 2 how will you get 3 as output plz explain sir
just love the explanation
please upload more dsa question.. i only want to learn from you
please upload more dsa question.. i only want to learn from you