Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Matrix multiplication method, fat free.

def climbStairs(self, n): a,b,x,y = 1,1,1,0 while n>0: if n&1: x, y = a*x + b*y, b*x + y*(a-b) a,b,n = a*a + b*b, 2*a*b - b*b, n>>1; return x;

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.