摘要: 这道题虽然不用到helper,但是却是那一路的参考code 包括有helper的http://blog.csdn.net/linhuanmars/article/details/24286377public class Solution { public ArrayList> subsets(... 阅读全文
posted @ 2015-04-16 11:55 世界到处都是小星星 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 三个指针,就是比较容易糊涂,要想清楚public class Solution { public void sortColors(int[] A) { if(A==null || A.length0 && A[p2]==2){ p2--; } ... 阅读全文
posted @ 2015-04-16 11:05 世界到处都是小星星 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 这道题有两种解法,第一种最好想吧,2次两分法,第二种是维度变换详细解释refhttp://www.cnblogs.com/springfor/p/3857959.htmlpublic class Solution { public boolean searchMatrix(int[][] ma... 阅读全文
posted @ 2015-04-16 06:19 世界到处都是小星星 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 和感染列岛那道题有点共鸣http://www.cnblogs.com/jiajiaxingxing/p/4405731.html这道题就是细节比较多吧code ganker 的总结http://blog.csdn.net/linhuanmars/article/details/39248597pub... 阅读全文
posted @ 2015-04-16 05:00 世界到处都是小星星 阅读(132) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String multiply(String num1, String num2) { if(num1==null || num2==null || num1.length()*num2.length()==0) re... 阅读全文
posted @ 2015-04-16 03:14 世界到处都是小星星 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 都还好吧,就是细节要想清楚,简单public class Solution { public String addBinary(String a, String b) { if(a==null) return b; if(b==null) return a; ... 阅读全文
posted @ 2015-04-15 13:28 世界到处都是小星星 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 总结数据处理帖子http://blog.csdn.net/linhuanmars/article/details/39046243这道题看似简单,但是有个优化必须要考虑到,就是如果没有进位,则应该立即返回public class Solution { public int[] plusOne(... 阅读全文
posted @ 2015-04-15 07:41 世界到处都是小星星 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 主要是细节和把握一位数组的能力public class Solution { public int minPathSum(int[][] grid) { if(grid==null || grid.length==0 || grid[0].length==0) return 0;... 阅读全文
posted @ 2015-04-15 06:13 世界到处都是小星星 阅读(150) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int uniquePathsWithObstacles(int[][] obstacleGrid) { if(obstacleGrid == null || obstacleGrid.length==0 || ob... 阅读全文
posted @ 2015-04-15 04:38 世界到处都是小星星 阅读(90) 评论(0) 推荐(0) 编辑
摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文
posted @ 2015-04-15 03:31 世界到处都是小星星 阅读(130) 评论(0) 推荐(0) 编辑