Fewest Door Visits
Each item of windows is [start, end]: a delivery that can arrive at any minute from start to end, both included. You can be at the door at minutes of your choice; a visit at minute t receives every delivery whose window contains t, that is start <= t <= end. Return the fewest visits needed so that every delivery is received. Return 0 if windows is empty. The windows may be given in any order, and start == end is allowed.
Example 1
A visit at minute 5 receives [1, 5] and [4, 8]; a visit at minute 10 receives [7, 10] and [9, 12]. No single minute lies in all four windows.
Example 2
The three windows share no minute, so each needs its own visit.
Constraints
0 <= len(windows) <= 1000 <= start <= end <= 1000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.