2017年5月25日

摘要: 方法一: 动态规划 https://segmentfault.com/a/1190000003768736 https://siddontang.gitbooks.io/leetcode-solution/content/dynamic_programming/perfect_squares.htm 阅读全文
posted @ 2017-05-25 12:15 codingEskimo 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Note:From back to start, if A[distance] is larger than the distance to the last element, it indicates that the last element is reachable. We can move 阅读全文
posted @ 2017-05-25 08:46 codingEskimo 阅读(120) 评论(0) 推荐(0) 编辑
摘要: public class Solution { /** * @param n: An integer * @return: An integer */ public int climbStairs(int n) { // write your code here if (n == 0 || n == 1) { ... 阅读全文
posted @ 2017-05-25 07:44 codingEskimo 阅读(84) 评论(0) 推荐(0) 编辑
摘要: public class Solution { /** * @param grid: a list of lists of integers. * @return: An integer, minimizes the sum of all numbers along its path */ public int minPathSum(int[][] ... 阅读全文
posted @ 2017-05-25 07:29 codingEskimo 阅读(74) 评论(0) 推荐(0) 编辑
摘要: Important point:During the iniitialize, the top or left side, if one grid is BLOCK, the rest of those points are all blocked. 阅读全文
posted @ 2017-05-25 07:13 codingEskimo 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Actually it can initial f[0][0] to 1, so that it can avoid a lot of coner checking. 阅读全文
posted @ 2017-05-25 06:53 codingEskimo 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Important: The hardest part is to define the state(here is f[x][y]) and its function(the relationship between them) 阅读全文
posted @ 2017-05-25 06:31 codingEskimo 阅读(110) 评论(0) 推荐(0) 编辑

导航