n days: on day i the stretch from jobs[i][0] to jobs[i][1] must be painted.
Painting any spot twice leaves blotches, so the painter only covers the part of the stretch that was not painted on earlier days.
Return an array of length n whose i-th element is the length of fence painted for the first time on day i.jobs=[[2, 6], [0, 3], [5, 9]] → [4, 2, 3]
Day 0 paints 2 to 6, length 4. On day 1 only the part from 0 to 2 of the stretch 0 to 3 is new, length 2. On day 2 the part 5 to 6 is already done, and 6 to 9 is new, length 3.
jobs=[[10, 20], [12, 15], [0, 30]] → [10, 0, 20]
Day 1's stretch lies entirely inside paint that is already there, so it adds 0. On day 2 the new parts are 0 to 10 and 20 to 30.
jobs=[[2, 6], [0, 3], [5, 9]]
[4, 2, 3]
Run checks the first 3 tests in your browser. Submit checks all 97 tests on the server, hidden ones included.