bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumMath & GeometryLC 54

Spiral Matrix

Given an m x n matrix, return all elements of the matrix in spiral order.

Asked at 24 companies
AdobeAmazonApple
Hints
  • 1.Think about what data structure fits Spiral Matrix
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode