Write a function to solve a string manipulation problem using a sliding window approach.
Implement longest_unique_substring(s) to return the length of the longest contiguous substring containing no repeated characters. The input is a string, and the output is an integer. Return 0 for an empty string.
s may contain lowercase letters, uppercase letters, digits, spaces, and punctuationdef longest_unique_substring(s):