Find Peak Element
mediumFind any element that is strictly greater than its neighbors. nums[-1] = nums[n] = -infinity
Find Peak Element
If the right neighbor is larger, a peak must exist to the right (array drops to -∞ at boundary). Always move uphill.
Find any peak (greater than both neighbors). nums[-1] = nums[n] = -∞.