摘要:
1005. K 次取反后最大化的数组和 public int largestSumAfterKNegations(int[] nums, int k) { if (nums.length == 1) { return k % 2 == 1 ? -nums[0] : nums[0]; } Arrays 阅读全文
摘要:
122. 买卖股票的最佳时机 II class Solution { public int maxProfit(int[] prices) { if (prices.length == 1) { return 0; } int interest = 0; int pre = 0, count = 0 阅读全文
摘要:
491. 递增子序列 LinkedList<Integer> path = new LinkedList<>(); List<List<Integer>> result = new ArrayList<>(); public List<List<Integer>> findSubsequences( 阅读全文
摘要:
93. 复原 IP 地址 List<String> result = new ArrayList<String>(); StringBuilder sb = new StringBuilder(); /** * <A href="https://leetcode.cn/problems/restor 阅读全文
摘要:
216. 组合总和 III LinkedList<Integer> path = new LinkedList<>(); List<List<Integer>> result = new ArrayList<>(); /** * @param k 规模 k 个数 * @param n 目标 和为 n 阅读全文
摘要:
第77题. 组合 class Solution { LinkedList<Integer> path =new LinkedList<>(); List<List<Integer>> result = new ArrayList<>(); public List<List<Integer>> com 阅读全文