We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e66950 commit f02248bCopy full SHA for f02248b
1 file changed
live9/test92/문제3/백한결.py
@@ -0,0 +1,22 @@
1
+def solution(book_time):
2
+ books = []
3
+
4
+ for start, end in book_time:
5
+ books.append((hour_to_minutes(start), 1))
6
+ books.append((hour_to_minutes(end) + 10, -1))
7
8
+ books.sort()
9
10
+ current_rooms = 0
11
+ needed_rooms = 0
12
13
+ for time, type in books:
14
+ current_rooms += type
15
+ needed_rooms = max(needed_rooms, current_rooms)
16
17
+ return needed_rooms
18
19
20
+def hour_to_minutes(time):
21
+ hour, minute = map(int, time.split(":"))
22
+ return hour * 60 + minute
0 commit comments