public class Solution {
public int climbStairs(int n) {
if (n <= 0) {
return 0;
} else if (n == 1) {
return 1;
}
int i = 1;
int j = 2;
int result = 2;
while (n >= 3) {
result = i + j;
i = j;
j = result;
n--;
}
return result;
}
}