First and Last Position of Element Sorted Array (LeetCode 34) | Full Solution | Study Algorithms

  Рет қаралды 16,292

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Пікірлер: 25
@saitejanedunoori5451
@saitejanedunoori5451 9 ай бұрын
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 .
@HarshChauhan-ur4jy
@HarshChauhan-ur4jy 4 ай бұрын
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!
@Sridevikrish21
@Sridevikrish21 5 ай бұрын
the way of teaching makes us to solve the more problems
@nikoo28
@nikoo28 5 ай бұрын
love it
@bhavyakarma8678
@bhavyakarma8678 2 ай бұрын
the best , easy and good approach for the problem thanku so much nikhil for this
@siva_avinash_
@siva_avinash_ Жыл бұрын
The way you make things clear is superr
@mikedelta658
@mikedelta658 10 ай бұрын
Fantastic and clear explanation. Thank you!
@nikoo28
@nikoo28 9 ай бұрын
You're very welcome!
@krishnenduroy3673
@krishnenduroy3673 3 ай бұрын
It was super smooth and easy to understand. Thanks 👍
@aarzoo2302
@aarzoo2302 Жыл бұрын
u explain everything and it was quite easy to understand, thankyouuu
@atifraza9960
@atifraza9960 3 жыл бұрын
The way of your explanation excellent 👏👏👏
@ashishsonii
@ashishsonii 2 ай бұрын
please upload more dsa question.. i only want to learn from you
@Parth-z1k
@Parth-z1k 3 жыл бұрын
Great Explanation👏👏👏
@rambhaktuchihaobito7987
@rambhaktuchihaobito7987 4 ай бұрын
Thank you sir ❤
@_shezzy
@_shezzy 7 ай бұрын
Will this solution work if input is [1,2,3] and target is 2
@casstansa
@casstansa 4 ай бұрын
brilliant🤩
@madhumithraravi9087
@madhumithraravi9087 3 жыл бұрын
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?
@nikoo28
@nikoo28 3 жыл бұрын
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 :)
@madhumithraravi9087
@madhumithraravi9087 3 жыл бұрын
@@nikoo28 Kind of recursive
@nikoo28
@nikoo28 3 жыл бұрын
Yes indeed…this is a recursive solution. Just like binary search.
@madhumithraravi9087
@madhumithraravi9087 3 жыл бұрын
@@nikoo28 thank you
@fero___3005
@fero___3005 2 жыл бұрын
@@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
@KUNALPRAJAPATI-fi3jy
@KUNALPRAJAPATI-fi3jy 8 ай бұрын
just love the explanation
@ashishsonii
@ashishsonii 2 ай бұрын
please upload more dsa question.. i only want to learn from you
@ashishsonii
@ashishsonii 2 ай бұрын
please upload more dsa question.. i only want to learn from you
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 60 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 13 МЛН
BS-3. First and Last Occurrences in Array | Count occurrences in Array
25:28
BS-8. Single Element in Sorted Array
22:16
take U forward
Рет қаралды 173 М.