Problem 3830 · Hard

Longest Alternating Subarray After Removing At Most One Element

Try each single deletion and track the longest run where the up and down steps alternate.

Open the interactive visualisation