← 返回 bloomberg 的题目列表Length of the Longest Substring Without Repeating Characters
类型:online_judge
Problem
Given a string s, return the length of the longest substring that contains no repeated characters.
Input
One line: string s
Output
An integer: the maximum length of a substring without repeating characters
Constraints
0 <= len(s) <= 2 * 10^5
s contains printable ASCII characters (you may treat it as standard ASCII)
Examples
Input: "abcabcbb" Output: 3
Input: "bbbbb" Output: 1
Input: "" Output: 0
Example
Input
abcabcbb
Output
3