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.
Sort the covered ranges, then sweep a cursor left to right; every stretch the cursor crosses before a covered range is a gap.