```
public int climbStairs(int n) {
int solution;
int[] solutions = new int[n + 2];
solutions[1] = 1;
solutions[2] = 2;
for (int i = 3; i <= n; i++) {
solutions[i] = solutions[i-2]+solutions[i-1];
}
return solutions[n];
}
```