Task scheduling
Let's say we have a machine which can run one program at a time. Machine is given a schedule and it will execute
the programs in the schedule. We want to know if a new program can be added to the schedule or not.
Time range: 0 to 10^6, duration
End times are exclusive
Example schedule input:
P1: <10, 2>
P2: <15, 5>
P3: <20, 1>
P4: <10000, 1>
Output:
True
True
True
True
Explanation:
P1: <10, 2> 10 - 12 is available
P2: <15, 5> 15 - 20 is available
P3: <20, 1> 20 - 21 is available
P4: <10000, 1> 10000 - 10001 is available