Problem 2951 · Easy

Find the Peaks

Scan the interior of the array and keep each index strictly greater than both neighbours.

Open the interactive visualisation