LeetCode 252. Meeting Rooms
Question
Given an array of meeting time intervals
where intervals[i] = [starti, endi]
, determine if a person could attend all meetings.
Example 1:
1 | Input: intervals = [[0,30],[5,10],[15,20]] |
Example 2:
1 | Input: intervals = [[7,10],[2,4]] |
Constraints:
0 <= intervals.length <= 104
intervals[i].length == 2
0 <= starti < endi <= 106
Source: https://leetcode.com/problems/meeting-rooms/
Solution
Sort intervals by start.
1 | // sort, O(nlog(n)) |
LeetCode 252. Meeting Rooms