摘要: 239. 滑动窗口最大值 https://leetcode.cn/problems/sliding-window-maximum/description/ public int[] maxSlidingWindow(int[] nums, int k) { int[] res = new int[n 阅读全文
posted @ 2024-03-18 11:21 jeasonGo 阅读(20) 评论(0) 推荐(0)
摘要: 20. 有效的括号 https://leetcode.cn/problems/valid-parentheses/description/ public boolean isValid(String s) { if (s == null) return true; Stack<Character> 阅读全文
posted @ 2024-03-16 11:11 jeasonGo 阅读(18) 评论(0) 推荐(0)
摘要: ![](https://img2024.cnblogs.com/blog/3402344/202403/3402344-20240315190211296-1966658901.jpg) 阅读全文
posted @ 2024-03-15 19:02 jeasonGo 阅读(7) 评论(0) 推荐(0)
摘要: 232. 用栈实现队列 https://leetcode.cn/problems/implement-queue-using-stacks/description/ class MyQueue { Stack<Integer> stackIn; Stack<Integer> stackOut; pu 阅读全文
posted @ 2024-03-15 11:16 jeasonGo 阅读(11) 评论(0) 推荐(0)
摘要: **28. 实现 strStr() ** https://leetcode.cn/problems/find-the-index-of-the-first-occurrence-in-a-string/description/ public void getNext(int[] next,Strin 阅读全文
posted @ 2024-03-14 23:22 jeasonGo 阅读(20) 评论(0) 推荐(0)
摘要: 73. 矩阵置零 https://leetcode.cn/problems/set-matrix-zeroes/description/?envType=study-plan-v2&envId=top-100-liked public void setZeroes(int[][] matrix) { 阅读全文
posted @ 2024-03-14 18:58 jeasonGo 阅读(10) 评论(0) 推荐(0)
摘要: 454. 四数相加 II https://leetcode.cn/problems/4sum-ii/description/、 public int fourSumCount(int[] nums1, int[] nums2, int[] nums3, int[] nums4) { int res 阅读全文
posted @ 2024-03-12 13:40 jeasonGo 阅读(12) 评论(0) 推荐(0)
摘要: 242. 有效的字母异位词 https://leetcode.cn/problems/valid-anagram/description/ public boolean isAnagram(String s, String t) { char[] sChar = s.toCharArray(); c 阅读全文
posted @ 2024-03-11 22:37 jeasonGo 阅读(20) 评论(0) 推荐(0)
摘要: 283. 移动零 https://leetcode.cn/problems/move-zeroes/description/?envType=study-plan-v2&envId=top-100-liked public void moveZeroes(int[] nums) { int r = 阅读全文
posted @ 2024-03-10 23:01 jeasonGo 阅读(27) 评论(0) 推荐(0)
摘要: 24. 两两交换链表中的节点 https://leetcode.cn/problems/swap-nodes-in-pairs/description/ public ListNode swapPairs(ListNode head) { if (head == null || head.next 阅读全文
posted @ 2024-03-09 10:23 jeasonGo 阅读(10) 评论(0) 推荐(0)