3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.
Example 1:
Input: “abcabcbb”
Output: 3
Explanation: The answer is “abc”, which the length is 3.
很显然这道题应该用双指针来做,但是注意两个问题:
第一:可以用数组来代替HashMap加快效率;
第二:对于每一个点检查时,左边界之外的部分是不用考虑的