Loading...
The Spiral Harvest
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid, senior
Problem
An image scanning algorithm reads pixel values in a spiral pattern starting from the outer edge. Write a function that takes a 2D matrix and returns all its elements in spiral order - starting from the top-left, going right, then down, then left, then up, inward.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.