← All problems
Find Peak Element
A peak element is strictly greater than its neighbors. Given an array where no two adjacent elements are equal, find any peak in O(log n) time.
Complexity
Time O(log n), Space O(1)
Common pitfalls
- Linear scan (misses the point)
- Boundary handling for mid+1
Your solution
Log in to save your code and track progress.