295. Employee Free Time

HardIntervals

We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order. Return the list of finite intervals representing common, positive-length free time for all employees, also in sorted order.

Examples

Input: [[[1,2],[5,6]],[[1,3]],[[4,10]]]

Output: [[3,4]]

Explanation: All employees are free between time 3 and 4.

Constraints

  • 1 <= schedule.length, schedule[i].length <= 50
  • 0 <= start < end <= 10^8
Loading...

Run checks all cases above. Submit evaluates all test cases.