Skip to content

Commit 7732790

Browse files
authored
Update climbing-stairs.py
1 parent 3941322 commit 7732790

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/climbing-stairs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def matrix_mult(A, B):
2727

2828
T = [[1, 1],
2929
[1, 0]]
30-
return matrix_mult([[1, 1]], matrix_expo(T, n-1))[0][0] # [a1, a0] * T^(n-1)
30+
return matrix_mult([[1, 0]], matrix_expo(T, n))[0][0] # [a0, a(-1)] * T^n
3131

3232

3333
# Time: O(n)

0 commit comments

Comments
 (0)