The Onion Layer
A hard Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Problem
Given an m x n 2D matrix, return a flat list of all elements in spiral order starting from the top-left corner and moving clockwise.
Summary
Peel from the outside in - one ring at a time.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.