滑动窗口
weixin_42604028
这个作者很懒,什么都没留下…
展开
-
239.滑动窗口最大值
1.优先级队列class Solution { public int[] maxSlidingWindow(int[] nums, int k) { //优先级队列 int n = nums.length; PriorityQueue<int[]> pq = new PriorityQueue<int[]>(new Comparator<int[]>() { public int compa原创 2021-11-05 12:36:47 · 402 阅读 · 0 评论 -
滑动窗口(3, 438,76)
滑动窗口(双指针)class Solution { public int lengthOfLongestSubstring(String s) { //滑动窗口(双指针!) int n = s.length(); Map<Character, Integer> map = new HashMap<>(); if(n == 0) return 0; int left = 0, ans = 1;原创 2021-08-13 12:37:46 · 46 阅读 · 0 评论