Given a string S, find the longest substring without repeating characters, and return its length. If any anagram of repeating substring exists, consider it as not repeating.
Example 1:
Input:abcabcbb
Output:3
Example 2:
Input:bbbbb
Output:1
Example 3:
Input:pwwkew
Output:3
Constraints:
The input string S contains only lowercase English letters.
The length of input string S will not exceed 10000.
solution.cpp
Loading...
Run code to see test results
00:00 / 69:42
Sieg 0
MediumMed•211 views
Given a string S, find the longest substring without repeating characters, and return its length. If any anagram of repeating substring exists, consider it as not repeating.
Example 1:
Input:abcabcbb
Output:3
Example 2:
Input:bbbbb
Output:1
Example 3:
Input:pwwkew
Output:3
Constraints:
The input string S contains only lowercase English letters.
The length of input string S will not exceed 10000.