#K86752. Longest Unique Substring

    ID: 36934 Type: Default 1000ms 256MiB

Longest Unique Substring

Longest Unique Substring

Given a string s, your task is to find the length of the longest contiguous substring that contains only unique characters. A substring is a sequence of characters that appears consecutively in s.

For example, if s is abcabcbb, then the longest substring without repeating characters is abc and its length is 3. Similarly, for bbbbb, the length is 1, and for pwwkew the length is 3.

The solution should account for all characters and be efficient even for large input strings.

inputFormat

The input consists of a single line containing the string s. The string may consist of letters, digits, and special characters. Note that the string can be empty.

outputFormat

Output a single integer representing the length of the longest substring with all unique characters.

## sample
abcabcbb
3

</p>