← 返回 netflix 的题目列表Longest Substring Without Repeating Characters
类型:online_judge
Given a string s, return the length of its longest contiguous substring that contains no repeated characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The longest substring without repeated characters is "abc".
Example 2:
Input: s = "pwwkew"
Output: 3
Explanation: The longest substring is "wke"; "pwke" is not contiguous.
Constraints:
0 <= len(s) <= 10^5
Characters may be any hashable characters.
Example
Input
abcabcbb
Output
3