Matrix Transformation

Matrix Algebra DS practice problem on Onlearn.

Difficulty: medium.

Topics: Understanding Matrix Transformation, Matrix Transformation, Matrix Inversion, Singular Matrix Detection, Input Validation, Floating Point Precision, Matrix Product Associativity, Linear Algebra, Matrix Operations, Numerical Computation, Software Engineering, Computational Mathematics, Matrix Invertibility, Determinant Calculation, Inverse Matrix Calculation, Matrix Multiplication, Error Handling.

Write a Python function that transforms a given matrix A using the operation $T^{ 1} A S$, where T and S are invertible matrices. The function should first validate if the matrices T and S are invertible, and then perform the transformation. In cases where there is no solution return 1