The longest substring without repeating characters, case-sensitive and including digits
TypeScript
Hard
strings
Task «The longest substring without repeating characters, case-sensitive and including digits»
Given a string consisting of Latin letters (uppercase and lowercase) and digits. It is necessary to find the length of the longest substring in which no character is repeated. Case is taken into account: 'a' and 'A' are different characters. If there are several such substrings, return the length of any one. If the string is empty, the answer is 0.
Input Format
One line containing a sequence of characters a-z, A-Z, 0-9. The length of the string is from 0 to 10^5.
Output Format
One integer — the length of the maximum substring without repetitions.
Examples
Example 1
INPUT
pwwkew
OUTPUT
3
Example 2
INPUT
abc
bca
OUTPUT
3
Example 3
INPUT
3
2 1 3
OUTPUT
1
main.ts