Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Diagonal Traverse
Bookmark
Group by Diagonal and Reverse
Direct Simulation
Input
3×3 Matrix
2×3 Matrix
3×4 Matrix
Single Element
Custom
matrix
=
[[1,2,3],[4,5,6],[7,8,9]]
MATRIX
1
2
3
4
5
6
7
8
9
RESULT
MATRIX
1
2
3
4
5
6
7
8
9
RESULT
MATRIX
1
2
3
4
5
6
7
8
9
RESULT
MATRIX
↙ down-left
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
MATRIX
↙ down-left
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
2
2
MATRIX
↗ up-right
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
2
4
MATRIX
↗ up-right
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
2
4
7
5
5
MATRIX
↙ down-left
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
2
4
7
5
3
MATRIX
↙ down-left
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
2
4
7
5
3
6
6
MATRIX
↗ up-right
1
2
3
4
5
6
7
8
9
row
col
RESULT
1
2
4
7
5
3
6
8
MATRIX
1
2
3
4
5
6
7
8
9
RESULT
1
2
4
7
5
3
6
8
9
algo
master
.
io
Step:
Start: Traverse by grouping cells on each anti-diagonal (r + c)
0 / 16
Input
3×3 Matrix
2×3 Matrix
3×4 Matrix
Single Element
Custom
matrix
=
[[1,2,3],[4,5,6],[7,8,9]]
0 / 16
algo
master
.
io
Step:
Start: Traverse by grouping cells on each anti-diagonal (r + c)