input: def min_chairs_required(s: str) -> int:
      """
      Given a string s, simulate the sequence of events as follows:
  
      If s[i] == 'E', a person enters the room, occupying a chair.
      If s[i] == 'L', a person exits the room, freeing a chair.
      Calculate the minimum number of chairs needed so that every entering person always has a chair, assuming an initially empty room.
  
      Examples:
      >>> s = "EEEEEEE"
      7
      >>> s = "ELELEEL"
      2
  
      Constraints:
      1 <= s.length <= 50
      s contains only 'E' and 'L'.
      s denotes a valid entry and exit order.
      """
output:     
      max_chairs = 0
      current_chairs = 0
  
      for event in s:
          if event == 'E':
              current_chairs += 1
              if current_chairs > max_chairs:
                  max_chairs = current_chairs
          elif event == 'L':
              current_chairs -= 1
  
      return max_chairs
  