Determinants of n x n matrices using the cofactor method.