The number of distinct ways is the Fibonacci Numbers, since when you climb the n stairs, you need distinct ways of n-1(1 more steps here) stairs plus distinct ways of n-2 stairs (2 more steps here). For example, when you climb 4 stairs, you can either climb 3 stairs (3 ways) and 1 more step or 2 sitars (2 ways) and 2 more steps, so there are 5 ways in total. So the solution becomes easy, here is a non- recursive one:

```
def climbStairs(self, n):
fib = {}
f=0
for i in range (1,n+1):
if i <= 2:
f = i
else:
f = fib[i-1] + fib[i-2]
fib[i] = f
return fib[n]
```