Problem 2600 · Easy

K Items With the Maximum Sum

Fill k picks with +1 items first, then zeros, and only then -1 items, taking each group with a single min().

Open the interactive visualisation