Problem 3323 · Medium

Minimize Connected Groups by Inserting Interval

Merge intervals into groups, then slide a window of groups that one added interval of length at most k can bridge.

Open the interactive visualisation