#C13977. Longest Unique Substring

    ID: 43574 Type: Default 1000ms 256MiB

Longest Unique Substring

Longest Unique Substring

You are given a string s. Your task is to find the length of the longest substring that contains no repeated characters. In other words, you need to identify a contiguous block of characters where every character appears only once and determine its length.

For example, if s = "pwwkew", the answer is 3, as the longest substring without repeating characters is "wke".

Note: The solution should use a sliding window technique for optimal performance. Use LaTeX to express any formula if needed. For instance, if you wish to denote the length of the substring, you can use the notation \(L = end - start + 1\), where start and end represent the indices of the current window.

inputFormat

The input consists of a single line containing a non-empty string s (which can include any visible characters).

The string is provided via standard input (stdin).

outputFormat

Output a single integer representing the length of the longest substring of s that contains all unique characters. The result should be printed to standard output (stdout).

## sample
aaaa
1