#C11182. Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Given a string s, your task is to compute the length of the longest substring that contains no repeating characters. This problem can be solved efficiently using the sliding window technique, where we maintain two pointers and use a hash map or array to record the last occurrence of each character.
The solution should read input from stdin and output the result to stdout. Pay close attention to edge cases such as empty strings and strings with all identical characters.
inputFormat
The input consists of a single line containing the string s.
outputFormat
Output an integer, which is the length of the longest substring of s without any repeating characters.
## sampleabcabcbb
3