```
public class Solution {
public int climbStairs(int n) {
int [] steps = new int[n+1];
if(n <=2)return n;
//base case
steps[0] = 0;steps[1] = 1;steps[2] = 2;
return steps(steps,n);
}
int steps(int[] steps,int n)
{
if(steps[n] != 0)
{
return steps[n];
}
else
{ steps[n] = steps(steps,n-1)+ steps(steps,n-2);
return steps[n];
}
}
```

}