Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
03
:
10
:
14
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.
...