← All problemsSign in

2951. Find the Peaks

LeetCodeArrayEnumerationOpen on judge ↗

You are given a 0-indexed array mountain. Your task is to find all the peaks in the mountain array. Return an array that consists of indices of peaks in the given array in any order. Notes: - A peak is defined as an element that is strictly greater than its neighboring elements. - The first and last elements of the array are not a peak. Example 1: Input: mountain = [2,4,4] Output: [] Expla

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start