9/41
Part 1 of 7 · SortingLearn and do

Sorted by start, a window can only overlap the merged window just before it

Merge Intervals is on Netflix's tag list too (1 source). A service has maintenance windows, (start, end) in hours, and you want the hours it's down:

windows = [(14, 16), (1, 3), (8, 10), (2, 6), (15, 18), (9, 12), (3, 5)]
print(merge(windows))
Predict

Windows (14, 16), (1, 3), (8, 10), (2, 6), (15, 18), (9, 12) and (3, 5), merged where they overlap. How many are left?

Pick one to see what it prints.
Pick an answer above to see the rest