We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e4d9f0 commit 3d56dd3Copy full SHA for 3d56dd3
1 file changed
live9/test94/문제2/백한결.py
@@ -0,0 +1,30 @@
1
+import heapq
2
+
3
+def solution(book_time):
4
5
+ book_time.sort()
6
7
+ start = []
8
+ end = []
9
10
+ for time in book_time:
11
+ start.append(hourToMinute(time[0]))
12
+ end.append(hourToMinute(time[1]) + 10)
13
14
+ rooms = []
15
+ heapq.heapify(rooms)
16
17
+ for i in range(len(book_time)):
18
+ if rooms and rooms[0] <= start[i]:
19
+ heapq.heappop(rooms)
20
21
+ heapq.heappush(rooms, end[i])
22
23
+ return len(rooms)
24
25
+def hourToMinute(time):
26
+ hour, minute = time.split(":")
27
28
+ minutes = int(hour) * 60 + int(minute)
29
30
+ return minutes
0 commit comments