Swap Square Matrix Example

Coding Question: Swap a 2D (square) array's values across the diagonal: [0,0], [1,1], [2,2], etc.

Size of Square Matrix:


Before Matrix Swap:



After Matrix Swap: