Concept Flow - Find Peak Element Using Binary Search
Start with array and low=0, high=n-1
Calculate mid = (low+high)/2
Compare nums[mid
nums[mid
| No
Move high to mid
Check if low == high
Return low as peak index
We repeatedly check the middle element and compare it with its right neighbor to decide which half to search next until low meets high, which is the peak.
