To avoid all the extra conditions, you can also set left = min_index and right = min_index + nums.length, ofcourse while accessing those indices will be out of bounds of the array, so while accessing real item indices you can just do "nums[] mod nums.length" and when its time to update the left or right bounds, use the "fake" indices.
Hi greg, I am your new subscriber from India. Love your content. I need a suggestion, Is DSA mandatory to learn if we want to get into data science field?
Master Data Structures & Algorithms For FREE at AlgoMap.io!
this was a very tricky problem for me, but your explanation is incredibly clear, thanks!
Isn't the 3rd case m,n-1 identical to edge case where m is position 0 ? 0,n-1 ? So why is 0,n-1 an edge case?
first = 0
last = len(nums) - 1
while first
To avoid all the extra conditions, you can also set left = min_index and right = min_index + nums.length, ofcourse while accessing those indices will be out of bounds of the array, so while accessing real item indices you can just do "nums[] mod nums.length" and when its time to update the left or right bounds, use the "fake" indices.
Hi greg,
I am your new subscriber from India. Love your content.
I need a suggestion, Is DSA mandatory to learn if we want to get into data science field?
Sorry for the extremely slow reply!! Yes, generally it is
this one got me fucked up
how would I come up with this one my own during interview ??
@@bishwut9209 ikr i really wonder how everyone else learn this shit
you should create a separate playlist for all your leetcode videos