Fall SalePremium questions, over 25% offUnlock all premium questions for over 25% off
Compress Nodes In N-ary Tree
Medium
Question
The input is an n-ary tree whose node values are all unique, together with a list compressedNodes. Every node named in that list must be compressed. To compress a node, delete it and hand its children to its parent: they take the deleted node's position among the parent's children, in their original order. compressedNodes never names the root. Return the root of the tree that results.
...
More Amazon interview questions
- Assign Books To Shelvesmedium
- Minimum Warehouse Redistribution Costmedium
- Detect Obfuscated Abusive Wordshard
- Minimum Variant Conversion Costmedium
- Diagonal Server Redirect Pathhard
- Prefix Frequency Block Partitioneasy
- Smallest Lexicographic Palindromemedium
- Connect Points In Unbounded Matrixhard
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.