Skip to content

Latest commit

 

History

History

challenge-65

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

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)]