Given a matrix with dimension m * n
, write a function called diagonalSort()
which sorts the matrix
diagonally in ascending order from the top left to the bottom right. Return the sorted matrix.
const matrix = [
[3,3,1,1],
[2,2,1,2],
[1,1,1,2]
]