bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumMath & GeometryLC 498

Diagonal Traverse

Given an m x n matrix mat, return an array of all the elements of the array in a diagonal order.

Asked at 8 companies
AmazonAppleEbay
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode