Meeting Rooms
Return whether one person can attend every meeting. Meeting intervals are half-open [start,end), so an ending meeting may be followed immediately by another.
Example 1
intervals = [[5,8],[1,3],[3,5]]trueExplanation
Sorted meetings end exactly where the next begins, allowing all three.
Example 2
intervals = [[1,4],[3,6]]falseExplanation
Both meetings occupy times 3..4, so attendance conflicts.
Example 3
intervals = []trueExplanation
No meetings impose no conflicts.
Constraints
- 0 <= number of meetings <= 10000
- Each interval has start < end
Function contract
canAttendMeetingsArguments: jsonSolutionRuns on your device
Loading draft…
Run: 3 examples; Submit: 34 cases, on your device.
[[5,8],[1,3],[3,5]]