| 40 | https://leetcode.com/problems/climbing-stairs/description/ |
| 41 | """ |
| 42 | class Solution(object): |
| 43 | def climbStairs(self, n): |
| 44 | """ |
| 45 | :type n: int |
| 46 | :rtype: int |
| 47 | """ |
| 48 | |
| 49 | if n < 1: |
| 50 | return 0 |
| 51 | |
| 52 | if n == 1: |
| 53 | return 1 |
| 54 | |
| 55 | dp = [] |
| 56 | dp.append(1) |
| 57 | dp.append(2) |
| 58 | |
| 59 | for i in range(2, n): |
| 60 | dp.append(dp[i-1]+dp[i-2]) |
| 61 | return dp[-1] |
| 62 |
nothing calls this directly
no outgoing calls
no test coverage detected