Problem 3748 · Hard

Count Stable Subarrays

Stable subarrays are the non-decreasing ones. Within a query, each index adds the length of the current non-decreasing run ending there.

Open the interactive visualisation