Employee Free Time Problem

Employee Free Time Problem — ExecCode Hard DSA Practice

Solve the Employee Free Time problem on ExecCode. Free online hard DSA practice in Intervals. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Each employee has a sorted list of non-overlapping busy intervals. Return the finite intervals when every employee is free. Merge all busy intervals across employees. Any gap between two merged busy intervals is common free time. Do not include time before the first busy interval or after the last busy interval because those are unbounded.

Examples

Input {"raw": "[[[1,2],[5,6]],[[1,3]],[[4,10]]]"}; Output [[3, 4]]. Input {"raw": "[[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]]"}; Output [[5, 6], [7, 9]]

Constraints

1 <= number of employees <= 50 1 <= total intervals <= 2500 0 <= start < end <= 10^9 Each employee schedule is sorted and non-overlapping.

Practice Employee Free Time free on ExecCode. Browse DSA problems, topic map, and placement guides.