Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 322 Bytes

File metadata and controls

11 lines (8 loc) · 322 Bytes

Problem 10: Angular Sweep (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.

Input Format

  • A 2D integer matrix mat.

Example

Input: mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Output: [1, 2, 4, 7, 5, 3, 6, 8, 9]