```
class Solution {
```

public:

int climbStairs(int n) {

if (n <=0 ) return 0;

if (n == 1) return 1;

```
int i = 1;
int j = 2;
int count = 3;
while (count <= n)
{
int temp = j;
j = i + j;
i = temp;
++count;
}
return j;
}
```

};