79327584

Date: 2025-01-03 20:20:07
Score: 0.5
Natty:
Report link

Matrix exponentiation solution with numpy:

import numpy as np

def fib(n):
    A = np.array([[1, 1], [1, 0]])
    return np.linalg.matrix_power(A, n)[0][1]
Reasons:
  • Low length (1):
  • Has code block (-0.5):
Posted by: Vardan Grigoryants