Employee Free Time
Difficulty: Hard
Category: DSA
Topics: Array, Line Sweep, Sorting, Heap (Priority Queue)
Asked at: DoorDash, Pinterest, Amazon, Intuit, Oracle, Bloomberg, Wayfair
You are given a list `schedule` where `schedule[i]` represents the list of non-overlapping, sorted intervals `[start, end]` during which the `i`-th employee is working. Each employee may have multiple working intervals, and intervals are represented as closed on the left and open on the right: `[start, end)`.
Your task is to find the finite intervals during which **all employees are free**—that is, periods when none of the employees are working. The free time intervals should not include any time before the earliest start time or after the latest end time among all employees' schedules.
Return a list of intervals representing the common free time, sorted in ascending order by start time. Each interval should be represented as a list `[start, end]`.