Sum of Distances from Nodes to a Special Node in Tree
Filed under Nutanix
The question
Given a weighted undirected tree with N nodes and a designated special node X, compute the sum of shortest path distances from all other nodes to node X.
No write-up yet. Related questions below have one.
Related Nutanix questions
Collected from public candidate posts and coding forums. Updated Nov 2026.