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
Move low=mid+1
Else mid is peak
Return mid
We repeatedly check the middle element and compare it with neighbors to decide which half to search next, narrowing down to a peak.
