slots. Each booking [start, end) takes the time from start inclusive to end exclusive.
A booking [a, b) is redundant if some other booking [c, d) in the list fully covers it: c ≤ a and b ≤ d. All redundant bookings are struck out.
Return how many bookings remain.slots=[[2, 6], [3, 5], [7, 9], [4, 8]] → 3
The booking [3, 5) lies entirely inside [2, 6) and is struck out. None of the other three fits inside another one, so the answer is 3.
slots=[[0, 10], [0, 4], [6, 10]] → 1
Both short bookings fit inside [0, 10), even though they share an endpoint with it. One booking remains.
slots=[[1, 3], [3, 5]] → 2
slots=[[2, 6], [3, 5], [7, 9], [4, 8]]
3
Run checks the first 3 tests in your browser. Submit checks all 107 tests on the server, hidden ones included.