
leetcode/dynamic planning
文章平均质量分 67
SUN123565
这个作者很懒,什么都没留下…
展开
-
leetcode-70 Climbing Stairs
问题描述地址:https://leetcode.com/problems/climbing-stairs/描述: 你正在爬楼梯,一共有n步可以到达顶端。每一次可以爬1步或者2步。问:有多少种方式可以到达顶端?原创 2016-11-05 17:28:00 · 240 阅读 · 0 评论 -
leetcode-64 Minimum Path Sum
问题描述地址:https://leetcode.com/problems/minimum-path-sum/ 描述: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along原创 2016-11-05 10:03:09 · 311 阅读 · 0 评论 -
leetcode-63 Unique Paths II
问题描述地址:https://leetcode.com/problems/unique-paths-ii/ 描述: Follow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empt原创 2016-11-04 17:51:06 · 224 阅读 · 0 评论 -
leetcode-62 Unique Paths
问题描述地址:https://leetcode.com/problems/unique-paths/ 描述: A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at原创 2016-11-04 16:15:16 · 291 阅读 · 0 评论 -
leetcode-53 maximum-subarray
原题链接: http://oj.leetcode.com/problems/maximum-subarray/ 这是一道非常经典的动态规划的题目,用到的思路我们在别的动态规划题目中也很常用,以后我们称为”局部最优和全局最优解法“。基本思路是这样的,在每一步,我们维护两个变量,一个是全局最优,就是到当前元素为止最优的解是,一个是局部最优,就是必须包含当前元素的最优的解。接下来说说动态规划的递推原创 2016-11-02 14:46:06 · 399 阅读 · 0 评论