MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / identity

Function identity

matrix/nth_fibonacci_using_matrix_exponentiation.py:33–34  ·  view source on GitHub ↗
(n: int)

Source from the content-addressed store, hash-verified

31
32
33def identity(n: int) -> list[list[int]]:
34 return [[int(row == column) for column in range(n)] for row in range(n)]
35
36
37def nth_fibonacci_matrix(n: int) -> int:

Callers 1

nth_fibonacci_matrixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected