input: def calculate_min_chairs_needed(events: str) -> int:
      """
      You are provided with a string representing events occurring at each second:
  
      If events[i] == 'E', a person enters the waiting room and occupies a chair.
      If events[i] == 'L', a person leaves the waiting room, making a chair available.
      Determine the smallest number of chairs required to ensure that everyone who enters can sit, assuming the waiting room is initially empty.
  
      Examples:
      >>> events = "EEEEEEE"
      7
      >>> events = "ELELEEL"
      2
  
      Constraints:
      1 <= events.length <= 50
      The string events contains only the characters 'E' and 'L'.
      The sequence of events is valid.
      """
output:     max_chairs_needed = 0
      current_occupancy = 0
  
      for event in events:
          if event == 'E':
              current_occupancy += 1
              if current_occupancy > max_chairs_needed:
                  max_chairs_needed = current_occupancy
          elif event == 'L':
              current_occupancy -= 1
  
      return max_chairs_needed