class Solution:
def climbStairs(self,n):
ans=[1,2,3,5]
while(len(ans)<n):
ans.append(ans[-1]+ans[-2])
return ans[n-1]
11-04
117
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
class Solution:
def climbStairs(self,n):
ans=[1,2,3,5]
while(len(ans)<n):
ans.append(ans[-1]+ans[-2])
return ans[n-1]