```
public class Solution {
public int climbStairs(int n) {
if(n <= 2)
return n;
else{
int [] steps = new int [n+1];
steps[0]=0;steps[1]=1;steps[2]=2;
for(int i = 3;i<=(n);i++)
{
steps[i] = steps[i-2]+steps[i-1];
}
return steps[n];
}
}
```

}