NumPy allowed · plain Python earns 10 bonus points
Computed matrix × vector transformation
Invert a square matrix using row operations and partial pivoting.
Implement matrix_inverse(A): augment A with the identity matrix [A | I] and perform Gauss-Jordan elimination with partial pivoting. If at any step the maximal pivot element is < 1e-9, return None. Otherwise return the inverse matrix with entries rounded to 4 decimals.
matrix_inverse(A: list[list[float]]) -> list[list[float]] | None