```
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
res=[0]*(n+1)
return self.climb_with_dp(n,res)
def climb_with_dp(self,n,res):
if n==0:
res[0]=1
if n==1:
res[1]=1
elif res[n]==0:
res[n]=self.climb_with_dp(n-1,res)+self.climb_with_dp(n-2,res) #recursion with memoization
return res[n]
```