Skip to main content
Spiral Matrix | AlgoCracked
AlgoCracked
ProblemsSpiral Matrix
Medium47.0% acceptance
ArrayMatrixSimulation

Spiral Matrix

Given an m x n integer matrix , return all of its elements in spiral order : start at the top-left, move right along the top row, down the right column, left along the bottom row, up the left column, and spiral inward until every cell is visited. Input format Input is [matrix] , a single 2-D array, e.g. [[[1,2,3],[4,5,6],[7,8,9]]] .

Loading workspace…