Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 500 Bytes

README.md

File metadata and controls

19 lines (12 loc) · 500 Bytes

Free slots in calendar

This problem was asked by Google.

Description

Given a set of busy time intervals of two people as in a calendar and a time window, find the free time intervals of both the people so as to arrange a new meeting.

Assume that events are chronologically sorted in a calendar.

Example

Calendar A: [(2,5), (10,14), (19,20), (27,30)]
Calendar B: [(3,5), (12,15), (18,21), (23,24)]
Time window: (1,35)

Output: [(1,2), (5,10), (15,18), (21,23), (24,27), (30,35)]