每次运行它时,都会弹出错误消息。
如果没有,为什么我看到人们到处都在循环使用list.start或list.end ????
示例代码:
def minMeetingRooms(self, intervals):
starts = []
ends = []
for i in intervals:
starts.append(i.start)
ends.append(i.end)
starts.sort()
ends.sort()
s = e = 0
numRooms = available = 0
while s < len(starts):
if starts[s] < ends[e]:
if available == 0:
numRooms += 1
else:
available -= 1
s += 1
else:
available += 1
e += 1
return numRooms
'''