摘要:
方法一: 动态规划 https://segmentfault.com/a/1190000003768736 https://siddontang.gitbooks.io/leetcode-solution/content/dynamic_programming/perfect_squares.htm 阅读全文
摘要:
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 阅读全文
摘要:
public class Solution { /** * @param n: An integer * @return: An integer */ public int climbStairs(int n) { // write your code here if (n == 0 || n == 1) { ... 阅读全文
摘要:
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[][] ... 阅读全文
摘要:
Important point:During the iniitialize, the top or left side, if one grid is BLOCK, the rest of those points are all blocked. 阅读全文
摘要:
Actually it can initial f[0][0] to 1, so that it can avoid a lot of coner checking. 阅读全文