Problem 2195 · Medium

Append K Integers With Minimal Sum

Append k distinct positive integers that are not already present, keeping the total sum as small as possible. The visual skips present values on the number line and collects the smallest free ones.

Open the interactive visualisation