Given a square matrix mat, return the sum of the matrix diagonals.
Include the sum of all the elements on the primary diagonal (top-left to bottom-right) and all the elements on the secondary diagonal (top-right to bottom-left) that are not part of the primary diagonal.