Find the Count of Monotonic Pairs II
Count splits of each nums value into a non-decreasing and a non-increasing part, using prefix sums for large inputs.
Count splits of each nums value into a non-decreasing and a non-increasing part, using prefix sums for large inputs.