Merge N-ary Trees by Key

Given a collection of N-ary trees, merge them into one tree.

Each node contains only a unique identifier key and a list of children. Only nodes with the same key may be merged:

  • All input r...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: