0054. Spiral Matrix

https://leetcode.com/problems/spiral-matrix

Description

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

Example 1:

Example 2:

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 1 <= m, n <= 10

  • -100 <= matrix[i][j] <= 100

ac

Last updated

Was this helpful?