摘要: 基础的动规。 方法一: 1.第一行,第一列初始化为1 2.board[i][j] = borad[i-1][j] + board[i][j-1]; 3.返回board[row-1][col-1] 1 if(m <= 0 || n <= 0) { 2 return 0; 3 } 4 int[][] b 阅读全文
posted @ 2016-03-05 09:30 warmland 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 道理我都懂,但是还是调了n久,写出来发现哪哪都没问题,最后发现是k没有-- 都是泪 1 public String getPermutation(int n, int k) { 2 if(n == 0 || k == 0) { 3 return ""; 4 } 5 k--; 6 List<Integ 阅读全文
posted @ 2016-03-05 09:19 warmland 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 public int jump(int[] nums) { 2 if(nums == null || nums.length == 0) { 3 return 0; 4 } 5 int reach = 0; 6 int lastReach = 0; 7 int step = 0; 8 for(i 阅读全文
posted @ 2016-03-05 00:04 warmland 阅读(109) 评论(0) 推荐(0) 编辑