Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Notice that numbers with equal sums of row and column indexes belong to the same diagonal.
Store them in tuples (sum, row, val), sort them, and then regroup the answer.