Search for the longest substring without repeating characters
C++
Medium
strings
Task «Search for the longest substring without repeating characters»
Given a string consisting of lowercase Latin letters. It is necessary to find the length of the longest substring in which all characters are unique. If there are several such substrings, output the length of the first found maximum substring. Constraints: the length of the string is from 1 to 10^5 characters.
Input Format
A single line containing a sequence of lowercase Latin letters.
Output Format
One integer — the length of the longest substring without repeating characters.
Examples
Example 1
INPUT
abcabcbb
OUTPUT
3
Example 2
INPUT
bbbbb
OUTPUT
1
main.cpp