摘要: 和39. Combination Sum基本是一样的,就是上一次迭代的时候从这个数的位置开始,不可以重复的话,就从下一个位置开始 1 public List<List<Integer>> combinationSum2(int[] candidates, int target) { 2 List<L 阅读全文
posted @ 2016-02-28 08:47 warmland 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Backtracking问题 1 public List<List<Integer>> combinationSum(int[] candidates, int target) { 2 List<List<Integer>> res = new ArrayList<List<Integer>>(); 阅读全文
posted @ 2016-02-28 08:31 warmland 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 方法一: 我直接用了java自带的split功能,比较赖皮 需要注意的就是只有空格的string会被裂成0个子串,所以处理一下 1 public int lengthOfLastWord(String s) { 2 if(s == null || s.length() == 0) { 3 retur 阅读全文
posted @ 2016-02-28 07:25 warmland 阅读(135) 评论(0) 推荐(0) 编辑