3426. Minimum Number of Chairs in a Waiting Room
My accepted Python solution to LeetCode problem 3426, Minimum Number of Chairs in a Waiting Room, running in 1ms.
- Difficulty: Easy
- Python
- Runtime 1ms
- Memory 17.5MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 1ms, memory 17.5MB, accepted 2025-12-29.
class Solution:
def minimumChairs(self, s: str) -> int:
current = 0
max_chairs = 0
for c in s:
if c == 'E':
current += 1
max_chairs = max(max_chairs, current)
else:
current -= 1
return max_chairs