Meeting Rooms
Given an array of meeting time intervals where intervals[i] = [start_i, end_i], determine whether a person could attend all meetings, i.e. return true if no two meetings overlap.
Open official problem prompt ↗Decide whether a single person can attend every meeting, which is true exactly when no two meetings overlap in time.
Checking a personal calendar for double-booking: line up appointments by start time and see if any begins before the one before it wraps up.
- Input
- intervals = [[0,30],[5,10],[15,20]]
- Output
- false
- Why
- [0,30] and [5,10] overlap (5 < 30), so the person cannot attend both.
1 <= intervals.length <= 10^40 <= start_i < end_i <= 10^6