#C5086. Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Given a string s
, your task is to find the length of the longest substring without repeating characters. This problem can be efficiently solved using a sliding window approach. The solution should read input from stdin and output the result to stdout as an integer.
Problem Details:
- Input: A single line containing the string
s
. - Output: A single integer representing the length of the longest substring of
s
that has no repeated characters.
For example, if the input is abcabcbb
, the output should be 3
because the longest substring without repeating characters is abc
.
inputFormat
The input is provided via stdin as a single line string s
. The string may contain spaces and other characters.
outputFormat
The output is a single integer printed to stdout representing the length of the longest substring without repeating characters.
## sampleabcabcbb
3