




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Convert the tree to an undirected graph to make it easier to handle.
Use BFS starting at the start node to find the distance between each node and the start node. The answer is the maximum distance.