Solve a medium LeetCode-style coding challenge. Implement length_of_longest_substring(s) to return the length of the longest substring of s containing no repeated characters. Input is a string and output is an integer; preserve character identity exactly as provided.
Examples: s = "abcabcbb" returns 3, because "abc" is the longest valid substring. s = "bbbbb" returns 1.
Constraints: 0 <= len(s) <= 5 * 10^4; s may contain letters, digits, symbols, and spaces.
s may contain letters, digits, symbols, and spacesdef length_of_longest_substring(s):