252. Meeting Rooms
This is a LeetCode premium problem — the official page requires a subscription. Read the full statement on leetcode.ca, a community mirror.
Difficulty: easy Acceptance: 59% Topics: Array, Sorting
View full problem on leetcode.ca
Official page on LeetCode (premium)
The link at the top of the mirror page opens the solution — skip it if you want to solve this yourself.
leetcode.ca is an independent community site — we don't own or maintain it, and it isn't affiliated with LeetCode.
Reading material
Reference solution (spoiler · python)
# Time: O(nlogn)
# Space: O(n)
class Solution(object):
def canAttendMeetings(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: bool
"""
intervals.sort(key=lambda x: x[0])
for i in xrange(1, len(intervals)):
if intervals[i][0] < intervals[i-1][1]:
return False
return True
Solution from kamyu104/LeetCode-Solutions · MIT