Problem 3250 · Hard

Find the Count of Monotonic Pairs I

Count splits of each nums value into a non-decreasing part and a non-increasing part with prefix sums.

Open the interactive visualisation