Given a string s, return the length of the longest substring that contains no repeated characters. A substring must be contiguous. The input is a string, and the output is a single integer.
Constraints
0 <= len(s) <= 5 * 10^4
s consists of English letters, digits, symbols, and spaces
An O(n) solution is expected
Function Signature
deflength_of_longest_substring(s):
Interviewer
Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.