Problem 1671 · Hard

Minimum Number of Removals to Make Mountain Array

For each peak, the longest strictly increasing run ending there and the longest strictly decreasing run starting there give the largest mountain.

Open the interactive visualisation