252. Meeting Rooms
https://leetcode.com/problems/meeting-rooms/
Python
class Solution:
def canAttendMeetings(self, intervals: List[List[int]]) -> bool:
if not intervals:
return True
intervals.sort(key=lambda interval: interval[0])
pre_end = intervals[0][1]
for interval in intervals[1:]:
if interval[0] < pre_end:
return False
pre_end = interval[1]
return True