Invert 2×2 and 3×3 matrices via adjugate, with singularity detection.
Input
Answer
Steps
Why it works
A⁻¹ undoes A: AA⁻¹ = I. The adjugate formula A⁻¹ = adj(A)/det(A) works because each cofactor combination either hits the determinant (diagonal) or cancels to zero (off-diagonal). Zero determinant ⇒ division by zero ⇒ no inverse.