Spiral Matrix

Problem: Spiral Matrix

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

Input Format

  • The first line contains two integers m and n....

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: