```
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
mem = [0]*n
mem[:2] = [0,1,2]
return self.steps(n,mem)
def steps(self,n,mem):
if n < 3:
return mem[n]
else:
if mem[n] == 0:
mem[n] = self.steps(n-1,mem) + self.steps(n-2,mem)
return mem[n]
```