1634. Clone N-ary Tree

Medium
Hash Table
Tree
Depth-First Search
Breadth-First Search

Description

Hints

Hint 1
Traverse the tree, keep a hashtable with you and create a clone node for each node in the tree.
Hint 2
Start traversing the original tree again and connect each child pointer in the cloned tree the same way as the original tree with the help of the hashtable.

Statistics

Acceptance
83.1%
Submissions
40,692
Accepted
33,817