3. Longest Substring Without Repeating Characters
Problem
Given a string, find the length of the longest substring without repeating characters.
Examples:
Related Topics:
Hash Table
Two Pointers
String
Analysis
遍历字符串时,以当前字符为结尾,符合题意的字符串长度为:当前位置 - maxOf(上一个重复字符出现的位置,上一个当前字符出现的位置)。
Code
Last updated