MediumArrays & Hashing
Spiral Matrix
Traverse matrix in spiral order
Solution Approach
Layer by layer simulation
Complexity Analysis
Time Complexity
O(m*n)Space Complexity
O(1)Complexity
Time:O(m*n)
Space:O(1)
Asked at
GoogleAmazonApple
Traverse matrix in spiral order
Layer by layer simulation
Time Complexity
O(m*n)Space Complexity
O(1)