Problem 3013 · Hard

Divide an Array Into Subarrays With Minimum Cost II

Fix the second start, then take the cheapest k - 2 values in the window of starts that stay within dist.

Open the interactive visualisation