Problem 1712 · Medium

Ways to Split Array Into Three Subarrays

Use prefix sums, then for each left cut binary search the range of middle cuts whose sums keep the order left at most middle at most right.

Open the interactive visualisation