Problem 3250 · Hard
Count splits of each nums value into a non-decreasing part and a non-increasing part with prefix sums.
Open the interactive visualisation