You are given an grid. Return the matrix obtained after sorting each of its diagonals according to the following rules:
Diagonals in the bottom left triangle, including the main diagonal, must be sorted in non increasing order.
Diagonals in the top right triangle, excluding the main diagonal, must be sorted in non decreasing order.
Constraints:
grid.length grid[i].length
grid[i][j]
You are given an grid. Return the matrix obtained after sorting each of its diagonals according to the following rules:
Diagonals in the bottom left triangle, including the main diagonal, must be sorted in non increasing order.
Diagonals in the top right triangle, excluding the main diagonal, must be sorted in non decreasing order.
Constraints:
grid.length grid[i].length
grid[i][j]