input: def min_chairs_needed(s: str) -> int:
      """
      Given a string s, simulate events occurring at each second i:
  
      If s[i] == 'E', a person enters the waiting area and takes one of the available chairs.
      If s[i] == 'L', a person exits the waiting area, freeing up a chair.
      Return the minimum number of chairs required to ensure a chair is available for every person who enters the waiting area, assuming the area starts out empty.
  
      Examples:
      >>> s = "EEEEEEE"
      7
      >>> s = "ELELEEL"
      2
  
      Constraints:
      1 <= s.length <= 50
      s only contains the characters 'E' and 'L'.
      s represents a valid sequence of entries and exits.
      """
output:     max_chairs = 0
      current_chairs = 0
      
      for char in s:
          if char == 'E':
              current_chairs += 1
              if current_chairs > max_chairs:
                  max_chairs = current_chairs
          elif char == 'L':
              current_chairs -= 1
      
      return max_chairs