Problem 1959 · Medium

Minimum Total Space Wasted With K Resizing Operations

Split the demand sequence into at most k+1 contiguous blocks, where each block's capacity is its largest value, and minimize the total unused capacity. The visual builds the block partition and tallies the wasted space for each choice.

Open the interactive visualisation