← 返回 microsoft 的题目列表Longest Substring Without Repeating Characters
类型:online_judge
Given a string s, find the length of the longest substring without repeating characters.
Input A string s containing only letters and spaces, where 0 <= s.length <= 5 * 10^4.
Output Return the length of the longest substring without repeating characters.
Example
Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Input: "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Input: "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3. Note that the substring "pwke" is not valid, as characters must be consecutive.
Example
Input
"abcabcbb"