摘要: public class Solution { public String multiply(String num1, String num2) { int[] digits=new int[num1.length()+num2.length()]; for(int i=0;i=0;i--) { if(i>0) ... 阅读全文
posted @ 2017-09-24 14:04 Weiyu Wang 阅读(147) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int trap(int[] height) { int sum=0; int l=0; int r=height.length-1; int left=0; int right=0; while(lleft) ... 阅读全文
posted @ 2017-09-24 13:15 Weiyu Wang 阅读(82) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int firstMissingPositive(int[] nums) { int i=0; while(i0&&nums[i]<=nums.length&&nums[i]!=nums[nums[i]-1]) { int tmp=nums[i]; ... 阅读全文
posted @ 2017-09-24 13:03 Weiyu Wang 阅读(106) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List> combinationSum2(int[] candidates, int target) { List> ret=new ArrayList>(); Arrays.sort(candidates); boolean[] used=new boolean[candidates.le... 阅读全文
posted @ 2017-09-24 04:22 Weiyu Wang 阅读(89) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public List> combinationSum(int[] candidates, int target) { List> ret=new ArrayList>(); Arrays.sort(candidates); generateCombination(new ArrayList(... 阅读全文
posted @ 2017-09-24 02:39 Weiyu Wang 阅读(117) 评论(0) 推荐(0) 编辑