LeetCode 498: Diagonal Traverse
Problem Restatement We are given an m x n matrix mat . We need to return all elements of the matrix in diagonal order. The traversal starts at the top-left cell, then moves along diagonals in alternating directions. For this matrix: mat = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ] The diagonal order is: [1, 2, 4, 7, 5, 3, 6, 8, 9] The official problem...