Concept Flow - Find Peak Element Using Binary Search
Start with array and low=0, high=n-1
Calculate mid = (low+high)/2
Check if nums[mid
Yes No
high = mid
Repeat until low == high
Return low (peak index)
We repeatedly check the middle element to see if it is a peak. If not, we move to the half that must contain a peak, narrowing the search until we find one.