Problem of the day
Given a string 'S' of length 'L', return the length of the longest substring without repeating characters.
Example:
Suppose given input is "abacb", then the length of the longest substring without repeating characters will be 3 ("acb").
Each input contains a single line which contains the string 'S', Where 'S' denotes the input string containing english letters ( both UpperCase and LowerCase), digits, symbols, and spaces.
Output Format:
Print a single integer denoting the length of the longest substring without repeating characters.
Note:
You do not need to print anything, it has already been taken care of. Just implement the given function.
0 <= L <= 10^5
Time limit: 1 sec
xyxyz
3
The substrings without repeating characters are "xy", "yx", "xyz", "yz", "z".
The longest substring out of these substrings is “xyz” of length 3.
xxx
1
The substrings without repeating characters is only "x" with length 1.