Solve a common algorithm problem, such as finding the longest substring without repeating characters.
Implement the function below and return the length of the longest contiguous substring containing no repeated characters. The input is a string, and the output is an integer.
Function signature: def length_of_longest_substring(s):
def length_of_longest_substring(s):