Skip to content

Files

Latest commit

7a7d3f2 · Oct 20, 2020

History

History

1329.Sort the Matrix Diagonally

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 16, 2020
Oct 20, 2020
Oct 20, 2020

English Version

题目描述

给你一个 m * n 的整数矩阵 mat ,请你将同一条对角线上的元素(从左上到右下)按升序排序后,返回排好序的矩阵。

 

示例 1:

输入:mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]
输出:[[1,1,1,1],[1,2,2,2],[1,2,3,3]]

 

提示:

  • m == mat.length
  • n == mat[i].length
  • 1 <= m, n <= 100
  • 1 <= mat[i][j] <= 100

解法

Python3

Java

...