We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7507b00 commit 5ff8112Copy full SHA for 5ff8112
meeting-rooms-ii/hu6r1s.py
@@ -0,0 +1,30 @@
1
+from typing import (
2
+ List,
3
+)
4
+from lintcode import (
5
+ Interval,
6
7
+
8
+"""
9
+Definition of Interval:
10
+class Interval(object):
11
+ def __init__(self, start, end):
12
+ self.start = start
13
+ self.end = end
14
15
+from heapq import heappush, heappop
16
17
+class Solution:
18
+ """
19
+ @param intervals: an array of meeting time intervals
20
+ @return: the minimum number of conference rooms required
21
22
+ def min_meeting_rooms(self, intervals: List[Interval]) -> int:
23
+ # Write your code here
24
+ intervals.sort()
25
+ ends = []
26
+ for start, end in intervals:
27
+ if ends and ends[0] <= start:
28
+ heappop(ends)
29
+ heappush(ends, end)
30
+ return len(ends)
0 commit comments