Problem 2655 · Medium

Find Maximal Uncovered Ranges

Sort the covered ranges, then sweep a cursor left to right; every stretch the cursor crosses before a covered range is a gap.

Open the interactive visualisation