Cod
Vector
Sheets
Dashboard
Sign In
Back
Meeting Rooms
Easy
Description
Hints (2)
Submissions
Array
Sorting
Intervals
Given an array of meeting time intervals `intervals` where `intervals[i] = [startᵢ, endᵢ]`, determine *if a person could attend all meetings*.
Example 1
Input:
intervals = [[0,30],[5,10],[15,20]]
Output:
false
Example 2
Input:
intervals = [[7,10],[2,4]]
Output:
true
Constraints
•
0 <= intervals.length <= 10⁴
•
intervals[i].length == 2
•
0 <= startᵢ < endᵢ <= 10⁶
Time Complexity
O(n log n)
Space Complexity
O(1)
A−
14
A+
Test Cases
Result
Custom Input
Run
Submit
Case 1
Input:
[[0,30],[5,10],[15,20]]
Expected:
false
Case 2
Input:
[[7,10],[2,4]]
Expected:
true
Case 3
Input:
[[5,8],[9,15]]
Expected:
true