LeetCode
Diagonal Traverse
Click
here
for an explanation.