July 4th Sale
Limited Time Deal: Unlock all premium questions for over 40% off
$10.42$6.25
10
:
09
:
27
:
41
Back to Dashboard
N-ary Tree Node Distance
Medium
FREE
You are given an N-ary tree. Each node has a unique integer value val and a list of child nodes. Given two integer values a and b representing nodes in the tree, return the minimum number of edges needed to travel from node a to node b. If either node is not present in the tree, return -1.
...