Problem 2970 · Easy

Count the Number of Incremovable Subarrays I

Use the increasing prefix and suffix with two pointers to count removable subarrays in linear time.

Open the interactive visualisation