Skip to main content
PreparationZone Logo
PreparationZone
Back to Coding

Coding · Medium · Pro

Spiral order traversal of a matrix

CodingMatrixSenior
Model answerPreview

Approach

  • Maintain top/bottom/left/right bounds.
  • Traverse top row, right col, bottom row, left col; shrink bounds.

Java Solution

Java
List<Integer> spiral…