Problem 3446 · Medium

Sort Matrix by Diagonals

Sort each diagonal of a square matrix, non-increasing on and below the main diagonal and non-decreasing above it.

Open the interactive visualisation