Given a string, find the maximum length substring containing no repeating characters using a sliding window approach.
Implement length_of_longest_substring(s), which accepts a string and returns an integer representing the maximum length. Return 0 for an empty string. Characters are compared exactly as provided, including spaces and symbols.
def length_of_longest_substring(s):