Citadel Interview Question

Sort a matrix by the diagonals