Longest Substring Without Repeating Characters.
Asked in the phone screen stage. Given a string s, return the length of its longest substring containing no repeated characters. Reported follow-ups include returning the first or last matching substring, or returning all longest matches.
Implement length_of_longest_substring(s), where s is a string and the output is an integer.
Examples:
s = "abcabcbb" returns 3, from "abc".s = "bbbbb" returns 1, from "b".Constraints: 0 <= len(s) <= 5 * 10^4. Characters may be any valid string characters.
def length_of_longest_substring(s):