def climbStairs(self, n):
n+=1
t=2.2360679774997
return 1/t*(((1+t)/2)**n-((1-t)/2)**n)+0.01
t=sqrt(5)
This is a Fibonacci series
And there is proof here.
Fibonacci series
def climbStairs(self, n):
n+=1
t=2.2360679774997
return 1/t*(((1+t)/2)**n-((1-t)/2)**n)+0.01
t=sqrt(5)
This is a Fibonacci series
And there is proof here.
Fibonacci series