Earliest Common Meeting Time
Problem statement
You are given one day's meeting schedules for several employees. schedules[i][j] = [start, finish] is a half-open busy interval in minutes from the start of the day.
Given a requested meeting length, return the earliest start minute at which every employee is free for the entire meeting. The meeting must finish by minute 1440. Return -1 if no common interval exists.
Function
earliestCommonMeeting(schedules: int[][][], length: int) → intExamples
Example 1
schedules = [[[60,150],[180,240]],[[0,210],[360,420]]]length = 120return = 240Every employee is free from minute 240 through minute 360, so 240 is the earliest valid start.
Example 2
schedules = [[[480,510]],[[240,330]],[[375,400]]]length = 180return = 0All employees are free from minute 0 through minute 180.
Constraints
1 <= schedules.length <= 1000 <= schedules[i].length <= 1000 <= start < finish <= 14401 <= length <= 1440