Implement a method to find the longest substring without repeating characters.
Use the signature def length_of_longest_substring(s):. The input is a string, and the method must return the length of the longest contiguous substring whose characters are all distinct. Return 0 for an empty string.
s may contain uppercase letters, lowercase letters, digits, punctuation, and whitespacedef length_of_longest_substring(s):