Problem 2972 · Hard

Count the Number of Incremovable Subarrays II

Fix the kept prefix and count the removable middles with a pointer into the increasing suffix.

Open the interactive visualisation