#3168

Minimum Number of Chairs in a Waiting Room

newbie · 195 · lc easy +16 · 79.2% accepted · 155 likes · top 90%

Description

Given a string s of 'E' (enter) and 'L' (leave) events, simulate a waiting room that starts empty. Each 'E' occupies a chair; each 'L' frees one. Return the minimum number of chairs needed so no one is left standing.

Code

1
2
3