Coding · Hard · Pro
Find common free time across employees' busy intervals
CodingIntervalsStaff
Approach
- Flatten all busy intervals, sort by start.
- Merge busy blocks; gaps between merged blocks are free time.
- Intersection of free windows across lists equals gaps in union of busy.
Java Solution
Java
public List<int[]> freeTime(List<List<int[]>> s…