1329. Sort the Matrix Diagonally 1332. Remove Palindromic Subsequences 1337. the K Weakest Rows in a Matrix 1353. Maximum Number of Events That Can Be Attended 1380. Lucky Numbers in a Matrix 1383. Maximum Perf
Given am * nmatrixmatof 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: m == m...
[LeetCode] 1329. Sort the Matrix Diagonally A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end. For example, the matrix diagonal starting frommat[2][0],...
1329. Sort the Matrix Diagonally 问题: 对二维数组,对角线排序 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: m == mat.length n == mat[i].length 1 <= m, n <= 100 1 <= mat[i][j] <= ...
1329. Sort the Matrix Diagonally (M) Sort the Matrix Diagonally (M) 题目 Amatrix diagonalis a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end. For example, thematrix diagonal...