Your question is Find Free Time Slots. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Amazon Advertising scheduling tools represent meetings as time intervals. Given an ordered list of scheduled meetings and the boundaries of a workday, return every interval during which the individual is free, using the same [start, end] format.
Meetings use half-open intervals: a meeting [start, end] occupies times from start inclusive to end exclusive. The input is ordered by nondecreasing start time, but meetings may overlap. Overlapping or touching meetings should be treated as one busy period. Return only free intervals with positive duration.
Implement find_free_time(meetings, day_start, day_end), where meetings is a list of two-element integer lists and day_start and day_end are integer minute offsets from midnight. All meetings are valid and lie within the workday. Return a list of two-element integer lists representing free intervals in chronological order.
def find_free_time(meetings, day_start, day_end):