#K2431. Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Given a string S, determine the length of the longest substring that does not contain any repeating characters. This problem can be efficiently solved using the sliding window technique, which helps achieve an O(n) time complexity.
For example, consider the string \( S = "abcabcbb" \). The longest substring without repeating characters is "abc", which has a length of 3.
Note: The solution should read from stdin
and output the result to stdout
.
inputFormat
A single line containing the input string S.
outputFormat
An integer representing the length of the longest substring that does not contain any repeating characters.## sample
0