Guys, I wanted some help regarding a binary search problem given in the end of this video
I found this video very helpful! but still not able to solve the challenge posted in the video. I know it is a binary search problem so that we minimize the height of stacks so it must be a finding minimum value in curve, but how do we know that there is one minimum value in it?
Thank You.
For finding min. cost , we need to find optimal height where there will be minima.
Now , there is a little twist because one can move the blocks also.
Check out my code for detailed explanation:
Approach: Binary Search
chirag2505 Thanks brother, I understood most of the parts. Great work!, You are finding the minimum value in the curve as described in video, but how do we know that there will be one minimum value and why the curve should have ever increasing values on both side of minimum value? Also there can be multiple minima right?
In that case the while loop will go forever, right?