Skip to content

Latest commit

 

History

History
67 lines (31 loc) · 1.07 KB

File metadata and controls

67 lines (31 loc) · 1.07 KB

中文文档

Description

Given a m * n matrix mat of integers, sort it diagonally in ascending order from the top-left to the bottom-right then return the sorted array.

 

Example 1:

Input: mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]

Output: [[1,1,1,1],[1,2,2,2],[1,2,3,3]]

 

Constraints:

    <li><code>m ==&nbsp;mat.length</code></li>
    
    <li><code>n ==&nbsp;mat[i].length</code></li>
    
    <li><code>1 &lt;= m, n&nbsp;&lt;= 100</code></li>
    
    <li><code>1 &lt;= mat[i][j] &lt;= 100</code></li>
    

Solutions

Python3

Java

...