Problem 3281 · Medium

Maximize Score of Numbers in Ranges

Binary search the minimum pairwise gap and place each chosen number as early as the gap allows inside its range.

Open the interactive visualisation