Back to Question

Find the Root of N-ary Tree (Graph Traversal)

Question Explain

Given a list of nodes in an $N$-ary tree, where each node has a list of its children, find the root node. The root is the only node that is not a child of any other node.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.