Spiral Order
Medium · rating 1500 · Matrix, Implementation
The first line contains r and c. The next r lines each have c integers. Print all elements in clockwise spiral order starting from the top-left, space-separated on one line.
Constraints: 1 ≤ r, c ≤ 100
Related problems
- Rotate Matrix 90° — Medium
- Credit Card Validation — Medium
- Rotate Array Right — Medium
- Run-Length Decode — Medium
- Shift Duration — Medium
- Heaviest Row — Medium