Add Project Euler problem 116 solution 1 (#6305)
* Add solution
* updating DIRECTORY.md
* Fix pre-commit
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
This commit is contained in:
@@ -29,7 +29,8 @@ def inverse_of_matrix(matrix: list[list[float]]) -> list[list[float]]:
|
||||
|
||||
D = Decimal # An abbreviation for conciseness
|
||||
|
||||
# Check if the provided matrix has 2 rows and 2 columns, since this implementation only works for 2x2 matrices
|
||||
# Check if the provided matrix has 2 rows and 2 columns
|
||||
# since this implementation only works for 2x2 matrices
|
||||
if len(matrix) != 2 or len(matrix[0]) != 2 or len(matrix[1]) != 2:
|
||||
raise ValueError("Please provide a matrix of size 2x2.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user