public class Solution {

public int climbStairs(int n) {

```
if(n == 0 || n == 1){
return 1;
} else if(n == 2){
return 2;
}
else{
int[] step = new int[n+1];
step[0] = 0;
step[1] = 1;
step[2] = 2;
int i = 3;
while(i < n ){
step[i] = step[i-1] + step[i-2];
i++;
}
step[n] = step[n-1] + step[n-2];
return step[n];
}
}
```

}