Problem editorialmedium
Find a peak element
There is no target and the array is not sorted. But the local slope always points toward higher ground — and uphill has to end in a summit somewhere.
17 min read·time O(log n)·space O(1)
Search on slopeNo targetGuaranteed descent