Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Simulate day-by-day removal of all current leaf nodes from an N-ary tree.
Nodes that become leaves after previous removals are removed in subsequent iterations.
Return a nested list grouping node values by the day they are removed.
What This Tests
Tree traversal and recursive decomposition
Bottom-up dynamic programming on trees
Level or depth assignment from leaves to root
Handling variable-degree graph structures
Common Patterns
DFS/BFS
Dynamic Programming
Graph Traversal
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Stdout
-