input: Write a python function to find the longest substring without repeating characters.
  assert longest_substring("abcdbcdab") == "abcd"
  assert longest_substring("bbbb") == "b"
  assert longest_substring("pwwkew") == "wke"
output: def longest_substring(s):
      start = maxLength = 0
      usedChars = {}
      maxSubstring = ""
  
      for i, char in enumerate(s):
          if char in usedChars and start <= usedChars[char]:
              start = usedChars[char] + 1
          else:
              if i - start + 1 > maxLength:
                  maxLength = i - start + 1
                  maxSubstring = s[start:i+1]
          
          usedChars[char] = i
  
      return maxSubstring