![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
borg_
这个作者很懒,什么都没留下…
展开
-
62. Unique Paths 动态规划
62 Unique Paths 对于目标点path[i][j],前一步只能从paths[i - 1][j]或者是paths[i][j - 1]这两个点到达。而且这中路径之前并没有走过,所以目标就是paths[i][j + 1] + paths[i + 1][j]。 def uniquePaths(self, m, n): paths = [[1] for i in rang...原创 2018-06-11 10:03:07 · 158 阅读 · 0 评论 -
63. Unique Paths II 动态规划
跟Unique Paths一样,也是使用动态规划的问题。 解决此题的方法也和之前一样,先建立一个与目标矩阵相同尺寸的矩阵,然后 class Solution: def uniquePathsWithObstacles(self, obstacleGrid): """ :type obstacleGrid: List[List[int]] ...原创 2018-09-13 14:24:52 · 160 阅读 · 0 评论