摘要: 203.移除链表元素 方法一:直接遍历,永远记得处理head, 删除链表必须有前驱。 /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() 阅读全文
posted @ 2024-08-16 17:32 爱刷题的小盒子 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 209.长度最小的子数组 class Solution { public int minSubArrayLen(int target, int[] nums) { int left = 0; int sum = 0; //int result = Integer.MAX_VALUE;无法编译,改成长 阅读全文
posted @ 2024-08-16 15:30 爱刷题的小盒子 阅读(126) 评论(0) 推荐(0) 编辑