摘要:
public List<List<Integer>> threeSum(int[] nums) { List<List<Integer>> ans = new ArrayList<>(); List<Integer> combine = new ArrayList<>(); dfs(nums, an 阅读全文
摘要:
public int maxSubArray(int[] nums) { int len = nums.length,ans = nums[0]; int[] dp = new int[len]; dp[0] = nums[0]; for(int i = 1; i < len; i++) { dp[ 阅读全文
摘要:
public int maxProfit(int[] prices) { if(prices.length < 2) return 0; int ans = 0, beforeMin = prices[0]; for(int i =1; i < prices.length; i++) { int p 阅读全文
摘要:
public int findDuplicate(int[] nums) { Arrays.sort(nums); System.out.println(Arrays.toString(nums)); int l = 0, r = nums.length - 1; while (l < r) { i 阅读全文
摘要:
public int findInMountainArray(int target, MountainArray mountainArr) { int len = mountainArr.length(); int l = 0, r = len; while(l < r) { int mid = l 阅读全文
摘要:
``java public List<List> combinationSum(int[] candidates, int target) { List<List> ans = new ArrayList<>(); List combine = new ArrayList<>(); dfs(cand 阅读全文
摘要:
public List<List> combinationSum(int[] candidates, int target) { List<List> ans = new ArrayList<>(); List combine = new ArrayList<>(); dfs(candidates, 阅读全文