input: Write a function to find the length of the longest substring without repeating characters.
  assert longestSubstringWithoutRepeatingCharacters("abcabcbb") == 3
  assert longestSubstringWithoutRepeatingCharacters("bbbbb") == 1
  assert longestSubstringWithoutRepeatingCharacters("pwwkew") == 3
  assert longestSubstringWithoutRepeatingCharacters("") == 0
output: def longestSubstringWithoutRepeatingCharacters(s: str) -> int:
      char_set = set()
      left = 0
      max_length = 0
  
      for right in range(len(s)):
          while s[right] in char_set:
              char_set.remove(s[left])
              left += 1
          char_set.add(s[right])
          max_length = max(max_length, right - left + 1)
  
      return max_length