Limits: 1s, 256 MB

Given an **N*N** size matrix, you have to re-arrange the elements of the matrix in such a way that the difference between the summation of the elements of the main diagonal and the summation of the elements of the seconday diagonal is as large as possible. You can swap between any two elements of the matrix to re-arrange the matrix.

This is a companion discussion topic for the original entry at https://toph.co/p/diagonal-sum