← 返回 microsoft 的题目列表Longest Substring Without Repeating Characters
类型:online_judge
Problem: Longest Substring Without Repeating Characters
Given a string s, return the length of the longest substring that contains no repeating characters.
Constraints
0 <= len(s) <= 2 * 10^5
s consists of printable ASCII characters
I/O Format (for this test)
Input:
One line containing string s
Output:
One integer: the maximum length of a substring with all unique characters
Test Cases
Case 1
Input:
abcabcbb
Output:
3
Case 2
Input:
bbbbb
Output:
1
Case 3
Input:
pwwkew
Output:
3
Case 4
Input:
Output:
0
Case 5
Input:
dvdf
Output:
3
Example
Input
abcabcbb
Output
3