Problem 2406 · Medium

Divide Intervals Into Minimum Number of Groups

Sort intervals by start and keep the earliest-finishing group that is free; the number of groups equals the largest overlap.

Open the interactive visualisation