jobs[i] = [start, end, duration]: it needs duration seconds of server time in total, somewhere within the seconds from start to end inclusive. Those seconds do not have to be consecutive.
In every second the server is either on (and then every job whose window contains that second may make progress) or off.
Return the smallest number of seconds the server has to be on so that every job gets done.jobs=[[1, 4, 2], [3, 6, 2], [6, 8, 1]] → 3
Switch the server on at seconds 3, 4 and 6: the first job runs at 3 and 4, the second at 4 and 6, the third at 6. That is 3 seconds.
jobs=[[2, 3, 2], [5, 5, 1]] → 3
The windows do not overlap and both jobs fill their windows completely: 2 + 1 = 3.
jobs=[[1, 10, 3], [4, 6, 3]] → 3
The second job needs seconds 4, 5 and 6, and the first job can run in those very seconds.
jobs=[[1, 4, 2], [3, 6, 2], [6, 8, 1]]
3
Run checks the first 3 tests in your browser. Submit checks all 97 tests on the server, hidden ones included.