Permute Solution
permute := mymod(Index2+(Index1-1), n);
temp := <##[Index1, permute] A;
permute := mymod(Index2-(Index1-1)+n, n);
temp2 := <##[Index1, permute] A;
/* Process the forward diagonals */
[south of R] temp := *<<[R] temp; -- calculate column products
[south of R] ldsum := +<< temp; -- sum the products
/* Process the reverse diagonals */
[south of R] temp2 := *<<[R] temp2; -- calculate column products
[south of R] rdsum := +<< temp2; -- sum the products
return ldsum - rdsum; -- Return the determinant