input: Write a python function to find the longest substring containing exactly 2 distinct characters.
  assert substring_2chars("abcbbbbcccbdddadacb")==10
  assert substring_2chars("eceba")==3
  assert substring_2chars("ccaabbb")==5
output: def substring_2chars(s: str) -> int:
      if len(s) == 0:
          return 0
      
      max_len = 0
      left = 0
      char_count = {}
      
      for right in range(len(s)):
          char = s[right]
          if char in char_count:
              char_count[char] += 1
          else:
              char_count[char] = 1
          
          while len(char_count) > 2:
              left_char = s[left]
              char_count[left_char] -= 1
              if char_count[left_char] == 0:
                  del char_count[left_char]
              left += 1
          
          max_len = max(max_len, right - left + 1)
      
      return max_len