Employee Free Time

Given a list of employees’ schedules, where each schedule is a list of non-overlapping intervals sorted by start time, find the common free time intervals for all employees. **Pattern focus:** Sweep Line Events. Aggregate all intervals and find gaps when everyone is free.

Examples

Example 1:

Input:

intervals = [[1,2],[5,6],[1,3],[4,10]]

Output:

[[3,4]]

Example 2:

Input:

intervals = [[1,2],[3,5],[2,3]]

Output:

[]
Loading...
Employee Free Time - Intervals DSA Problem