Problem 2763 · Hard

Sum of Imbalance Numbers of All Subarrays

Sum the imbalance numbers over all subarrays, where imbalance counts adjacent sorted gaps larger than 1.

Open the interactive visualisation