Search⌘ K
AI Features

Find Peak Element

Find Peak Element asks you to return an index of any array value greater than its immediate neighbors, including virtual negative-infinity boundaries at both ends, in logarithmic time.

Statement

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