We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3941322 commit 7732790Copy full SHA for 7732790
Python/climbing-stairs.py
@@ -27,7 +27,7 @@ def matrix_mult(A, B):
27
28
T = [[1, 1],
29
[1, 0]]
30
- return matrix_mult([[1, 1]], matrix_expo(T, n-1))[0][0] # [a1, a0] * T^(n-1)
+ return matrix_mult([[1, 0]], matrix_expo(T, n))[0][0] # [a0, a(-1)] * T^n
31
32
33
# Time: O(n)
0 commit comments