Employee Free Time
You are given a schedule representing the working times of multiple employees. Each employee's schedule is a list of non-overlapping busy intervals sorted by start time, and each interval is represented as [start, end].
Return a list of finite intervals representing the common free time for all employees, also as [start, end] intervals, sorted by start time.
A common free-time interval is a time range during which every employee is free. Do not include intervals of length 0, and do not include unbounded intervals before the earliest busy time or after the latest busy time.
schedule = [[[1,2],[5,6]],[[1,3]],[[4,10]]][[3,4]]schedule = [[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]][[5,6],[7,9]]Constraints
- 1 <= schedule.length <= 50
- 1 <= schedule[i].length <= 50
- 0 <= schedule[i][j][0] < schedule[i][j][1] <= 10^8
- Each employee's intervals are sorted by start time and non-overlapping
Asked at 13 companies
Practice questions like this out loud in a mock coding interview with a live AI interviewer. First one free.