Search⌘ K
AI Features

Closest Node to Path in Tree

Closest Node to Path in Tree gives a tree and queries with a start, end, and target. Return the node on each start-to-end path nearest the target by edge distance, using the smaller index for ties.

Statement

You are given a positive integer, n, representing the number of nodes in a tree, numbered from 0 ...