#K70182. Longest Special Substring

    ID: 33252 Type: Default 1000ms 256MiB

Longest Special Substring

Longest Special Substring

You are given a string s. Your task is to find the length of the longest substring of s in which every character appears exactly once. In other words, a substring is considered special if for every character \( c \) in the substring, the frequency \( \text{count}(c)=1 \).

For example, if s = "abcabcbb", the longest special substring is "abc", whose length is 3.

Note: The substring must be a contiguous sequence of characters from the input string.

inputFormat

The input consists of a single line containing the string s.

Constraints: The string s may contain letters, digits, and other printable characters.

outputFormat

Output a single integer which is the length of the longest substring of s that contains all unique characters (i.e. each character appears exactly once).

## sample
abcabcbb
3