Skip to content

Commit 9c0acae

Browse files
authored
Update meeting-rooms.py
1 parent 118725e commit 9c0acae

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Python/meeting-rooms.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
# Space: O(n)
33

44
class Solution(object):
5-
# @param {Interval[]} intervals
6-
# @return {boolean}
75
def canAttendMeetings(self, intervals):
8-
intervals.sort(key=lambda x: x.start)
6+
"""
7+
:type intervals: List[List[int]]
8+
:rtype: bool
9+
"""
10+
intervals.sort(key=lambda x: x[0])
911

1012
for i in xrange(1, len(intervals)):
11-
if intervals[i].start < intervals[i-1].end:
13+
if intervals[i][0] < intervals[i-1][1]:
1214
return False
1315
return True
14-

0 commit comments

Comments
 (0)