input: Write a python function to find the length of the longest substring without repeating characters.
  assert longest_substring('abcabcbb') == 3
  assert longest_substring('bbbbb') == 1
  assert longest_substring('pwwkew') == 3
  assert longest_substring('') == 0
  assert longest_substring('au') == 2
output: def longest_substring(s):
      char_index = {}
      longest = 0
      start = 0
  
      for i, char in enumerate(s):
          if char in char_index and char_index[char] >= start:
              start = char_index[char] + 1
          char_index[char] = i
          longest = max(longest, i - start + 1)
  
      return longest