#C4077. Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Given a string s
, find the length of the longest substring without repeating characters.
The problem can be formally defined as follows: Let \( s = s_0s_1\ldots s_{n-1} \) be a string. Find the maximum integer \( L \) such that there exists an index \( i \) with the property that \( s[i], s[i+1], \ldots, s[i+L-1] \) are all distinct characters. Use an efficient algorithm with a sliding window technique.
Note: The input will be provided via standard input (stdin) as a single line, and the answer should be printed to standard output (stdout).
inputFormat
The input consists of a single line containing the string s
. The string may contain letters, digits and symbols.
outputFormat
Output a single integer representing the length of the longest substring of s
that contains no repeating characters.
abcabcbb
3