Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Remove specified nodes from an N-ary tree while promoting their children to the deleted node's parent.
Calculate the maximum height defined as the longest root-to-leaf path measured in kept nodes.
Root remains intact, and deletion effectively skips depth accumulation for removed nodes.
What This Tests
Recursive tree traversal with state propagation
Efficient filtering using hash-based lookups
Dynamic programming principles applied to tree paths
Simulating structural changes without actual memory reallocation
Common Patterns
DFS/BFS
Dynamic Programming
Hashing
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Accepted
2.6k
/3.5k
Acceptance Rate
74.5%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Stdout
-