You are given a string s representing a sequence of events occurring in a waiting room at each second.
Each character in s describes an event:
'E' indicates that a person enters the waiting room and takes a chair.
'L' indicates that a person leaves the waiting room and vacates a chair.
At any time, the waiting room must have enough chairs to accommodate every person currently present. Return the minimum number of chairs required so that there is always an available chair for each person entering the room.
Constraints:
s.length
s consists only of the letters 'E' and 'L'.
s represents a valid sequence of entries and exits.
You are given a string s representing a sequence of events occurring in a waiting room at each second.
Each character in s describes an event:
'E' indicates that a person enters the waiting room and takes a chair.
'L' indicates that a person leaves the waiting room and vacates a chair.
At any time, the waiting room must have enough chairs to accommodate every person currently present. Return the minimum number of chairs required so that there is always an available chair for each person entering the room.
Constraints:
s.length
s consists only of the letters 'E' and 'L'.
s represents a valid sequence of entries and exits.