</>OfferRetriever
DashboardDiscuss
NEW
Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
$10.42$7.08/mo

--

:

--

:

--

:

--

Get this deal
Back to Scale AI Questions

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.


...

Asked at:Scale AI

More Scale AI interview questions

All Scale AI interview questions
OfferRetriever

Master technical interviews with real questions from top companies. Build your confidence and career.

PRODUCT
PricingDashboardDiscussOfferRetriever vs LeetCodeCompare
LEGAL

© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.