2015年5月28日
摘要: public class Solution { public ArrayList> subsetsWithDup(int[] nums) { ArrayList> res = new ArrayList>(); ArrayList list = new ArrayL... 阅读全文
posted @ 2015-05-28 10:23 kikiUr 阅读(92) 评论(0) 推荐(0) 编辑
摘要: public int removeDuplicates(int[] A) { if(A==null || A.length==0) return 0; int idx = 0; int count = 0; for(int i=0;i0 && A[i]==A[i... 阅读全文
posted @ 2015-05-28 10:04 kikiUr 阅读(99) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public ArrayList> subsets(int[] nums) { ArrayList> res = new ArrayList>(); ArrayList list = new ArrayList(); ... 阅读全文
posted @ 2015-05-28 09:44 kikiUr 阅读(148) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public List insert(List intervals, Interval newInterval) { List res = new ArrayList(); if (intervals == null ... 阅读全文
posted @ 2015-05-28 09:28 kikiUr 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 先给interval排序,在java中实现要给interval 自定义一个Comparator排序可以用Collections.sort(intervals, new IntervalComparator());参考:http://www.cnblogs.com/springfor/p/387233... 阅读全文
posted @ 2015-05-28 08:26 kikiUr 阅读(87) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean canJump(int[] nums) { if (nums == null || nums.length == 0) { return false; } ... 阅读全文
posted @ 2015-05-28 08:22 kikiUr 阅读(128) 评论(0) 推荐(0) 编辑
摘要: DPpublic class Solution { public int jump(int[] A) { if (A == null || A.length == 0) { return 0; } int reac... 阅读全文
posted @ 2015-05-28 08:21 kikiUr 阅读(101) 评论(0) 推荐(0) 编辑
  2015年5月23日
摘要: public class Solution { public void rotate(int[][] matrix) { if (matrix == null || matrix.length == 0) { return; } ... 阅读全文
posted @ 2015-05-23 05:37 kikiUr 阅读(93) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int minPathSum(int[][] grid) { if (grid == null || grid.length == 0) { return 0; } i... 阅读全文
posted @ 2015-05-23 04:54 kikiUr 阅读(95) 评论(0) 推荐(0) 编辑
  2015年5月22日
摘要: 和3sum 相似 ,比3sum多一层循环。public class Solution { public ArrayList> fourSum(int[] nums, int target) { ArrayList> res = new ArrayList>(); i... 阅读全文
posted @ 2015-05-22 15:55 kikiUr 阅读(118) 评论(0) 推荐(0) 编辑