leetcode -- Climbing Stairs -- 简单重要
2015-12-08 23:16
453 查看
https://leetcode.com/problems/climbing-stairs/
简单的dp思路
d
= d[n - 1] + d[n - 2]
简单的dp思路
d
= d[n - 1] + d[n - 2]
class Solution(object): def climbStairs(self, n): """ :type n: int :rtype: int """ d = [0,1,2] for i in xrange(3,n + 1): d.append(d[i - 1] + d[i - 2]) return d
相关文章推荐
- xtrabackup版本较低触发nfs-v4的bug:cp: failed to preserve ownership: Invalid argument
- zzulioj 1809: make pair (数学转换求余简化)
- Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define 解决
- Daily Scrumming* 2015.12.8(Day 1)
- LeetCode 011 Container With Most Water
- 【转】MegaSAS RAID卡 BBU Learn Cycle周期的影响
- Daily Scrum 12.8
- nltk modules main
- lightoj1086 Jogging Trails
- 物理学家:用数学理论证明人工智能无法超越人类智慧
- Apktool 打包签名后安装出现 INSTALL_PARSE_FAILED_NO_CERTIFICATES错误
- Failover失效转移详解
- LeetCodeOJ_11_m_Container With Most Water
- LeetCode 219 Contains Duplicate II
- svn无法提交问题,The working copy failed to commit files
- LeetCode 217 Contains Duplicate
- 浅谈RAID写惩罚与IOPS计算[转载]
- UVA 11029 Leading and Trailing
- 事件传递之响应链(Event Delivery: The Responder Chain)【转】
- 游戏AI - 行为树Part2:框架