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.
Stable subarrays are the non-decreasing ones. Within a query, each index adds the length of the current non-decreasing run ending there.