Longest Substring Without Repeats
Find the length of the longest substring of S in which no character appears twice.
Input: one line with the string S.
Output: the maximum length of a repeat-free substring.
Constraints:
- 1 ≤ |S| ≤ 104
- S contains lowercase English letters
Sample Tests
Input 1
abcabcbb
Output 1
3
Input 2
bbbb
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.