随笔分类 -  滑动窗口

摘要:219. 存在重复元素 II Solution 思路1: 重复元素 然后就用HashMap不断更新最新出现的位置 与k值判断即可。 class Solution { public boolean containsNearbyDuplicate(int[] nums, int k) { Map<Int 阅读全文
posted @ 2022-01-19 16:56 Frontierone 阅读(24) 评论(0) 推荐(0)
摘要:传送门 Solution 思路1: 滑动窗口。维护窗口内字符的数量,判断与$p$字符串数量是否相等。复杂度$O((sLen-pLen)*26)$ class Solution { public List<Integer> findAnagrams(String s, String p) { int 阅读全文
posted @ 2021-11-29 23:35 Frontierone 阅读(52) 评论(0) 推荐(0)
摘要:#1831 : 80 Days #1831 : 80 Days 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 80 Days is an interesting game based on Jules Verne's science fiction "Around th 阅读全文
posted @ 2018-10-04 16:26 Frontierone 阅读(279) 评论(0) 推荐(0)