Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Given two people calendars, find the blocks of time when both can attend to a meeting.
Drew's spare blocks of time: [[10:00, 11:30], [12:30, 14:30], [14:30, 15:00]]
Drew begins his day at 10:00 and leaves at 18:30, ([10:00, 18:30]).
Julian's spare blocks of time: [[09:00, 10:30], [12:00, 13:00], [16:00, 18:00]]
Julian begins his day at 09:00 and leaves at 20:00, ([09:00, 20:00]).
Expected Result:
* Slot: 10:00 -- 10:30
* Slot: 12:30 -- 13:00
Goal: Write a function that returns the list of blocks of time when to schedule a meeting between them.
Notes:
* You can assume the times are sorted
* You can expect valid inputs
* 3pm is 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment