Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

Given an n-ary tree where each node has a unique value, implement a function to compress the tree by "compressing" specified nodes in compressedNodes list. When a node is compressed, its children are promoted to be direct children of its parent. Note that the root is never compressed. Return the modified tree's root.

Stdout
-