```
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
ways=[1,2];
for i in range(2,n):
ways.append(ways[i-1]+ways[i-2])
return ways[n-1]
```