Search
⌘K

Leetcode 1506. Find Root of N-Ary Tree

Given an unordered list of all nodes of an N-ary tree (nodes have children pointers but no parent pointers), identify the root — the single node that never appears as any node's child — in linear time (e.g., by set difference or XOR of values).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.