498. Diagonal Traverse
Problem Statement
Given an m x n
matrix mat
, return an array of all the elements of the array in a diagonal order.
Example 1:
Example 2:
Constraints:
m == mat.length
n == mat[i].length
1 <= m, n <= 104
1 <= m * n <= 104
-105 <= mat[i][j] <= 105
Intuition
Links
https://leetcode.com/problems/diagonal-traverse/
Video Links
Approach 1:
C++
Approach 2:
C++
Approach 3:
C++
Approach 4:
C++
Similar Problems
Last updated