Surveillance Footage I
Cameras produced footage clips, each covering a time interval [start, end]. Return the fewest clips whose union covers the whole window [0, T], or -1 when it's impossible.
clips = [[0,2], [4,6], [8,10], [1,9], [1,5], [5,9]], T = 10 -> 3 ([0,2] + [1,9] + [8,10])
Clips arrive in any order and may overlap arbitrarily; touching clips such as [0, 2] and [2, 5] leave no hole.
Hints
Hint 1
Sort by start. Among every clip that starts at or before the point you've covered so far, only one matters: the one reaching farthest right.
Hint 2
If no candidate reaches past your current coverage, you're stuck — that's the impossible case, detected mid-sweep rather than up front.