Spiral Matrix
Try to solve the Spiral Matrix problem.
Statement
Given an matrix, return an array containing the matrix elements in spiral order, starting from the top-left cell.
Constraints:
-
matrix.length
-
matrix[i].length
-
matrix[i][j]
Examples
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy