Search⌘ K
AI Features

Find Peak Element

Explore how to find a peak element in an integer array where each peak is greater than its neighbors. Learn to apply a modified binary search algorithm that runs in O(log n) time, enabling you to solve this problem efficiently by understanding array boundaries and peak conditions.

Statement

You’re given a 0-indexed integer array nums. An index i is called a peak if ...