← All problems

Find Peak Element

Medium searchingarrays LeetCode ↗
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.

Hints (0/3 revealed)

Log in to reveal hints progressively.

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.