input: Write a python function to find the length of the longest substring without repeating characters.
  assert longest_distinct_substring("abcabcbb") == 3
  assert longest_distinct_substring("bbbbb") == 1
  assert longest_distinct_substring("pwwkew") == 3
  assert longest_distinct_substring("dvdf") == 3
output: def longest_distinct_substring(s: str) -> int:
      char_map = {}
      left = 0
      max_length = 0
  
      for right in range(len(s)):
          if s[right] in char_map and char_map[s[right]] >= left:
              left = char_map[s[right]] + 1
          char_map[s[right]] = right
          max_length = max(max_length, right - left + 1)
  
      return max_length