LeetCode 3. Longest Substring Without Repeating Characters
这道题是一道滑动窗口的典型题目。
class Solution {
public int lengthOfLongestSubstring(String s) {
Set<Character> window = new HashSet<>();
int slow = 0, fast = 0, ans = 0, n = s.length();
while(fast < n){
if(!window
原创
2020-07-18 07:01:31 ·
82 阅读 ·
0 评论