All the Way Down
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
A config export arrives as a list whose entries are either plain values or further lists, nested to arbitrary depth with no fixed structure. Collapse it into a single flat list holding every leaf value in left-to-right order. Treat strings as leaf values, not as sequences to descend into.
Summary
However deep it nests, every leaf belongs on one line.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.