Problem 1506 · Medium

Find Root of N-Ary Tree

Given every node of an N-ary tree in arbitrary order, find the one node that no other node lists as a child.

Open the interactive visualisation