Skip to content

Commit 2eb8c30

Browse files
committed
Day15
1 parent c13bcd5 commit 2eb8c30

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

leetcode3/최민지/3168.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution:
2+
def minimumChairs(self, s: str) -> int:
3+
maxCount = 0 # 필요한 의자 수
4+
temp = 0 # 대기실에 있는 사람
5+
for i in range(len(s)):
6+
if s[i] == 'E':
7+
temp += 1
8+
maxCount = max(temp, maxCount)
9+
if s[i] == 'L':
10+
temp -= 1
11+
maxCount = max(temp, maxCount)
12+
13+
return maxCount
14+
15+

0 commit comments

Comments
 (0)