摘要: 双指针 class Solution { public int minSubArrayLen(int s, int[] nums) { if (nums.length == 0) return 0; int ans = Integer.MAX_VALUE; int start = 0, end = 阅读全文
posted @ 2020-10-22 11:19 消灭猕猴桃 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 递归 class Solution { // 1. 确定函数参数以及返回值 public TreeNode trimBST(TreeNode root, int low, int high) { // 2.确定终止条件 if (root == null) return null; // 3. 确定单 阅读全文
posted @ 2020-10-22 09:36 消灭猕猴桃 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 贪心算法+双指针 class Solution { public List<Integer> partitionLabels(String S) { // 字符串S中每个字母最后出现的下标 int[] last = new int[26]; int length = S.length(); for 阅读全文
posted @ 2020-10-22 08:38 消灭猕猴桃 阅读(60) 评论(0) 推荐(0) 编辑