...

/

Sum of Distances in a Tree

Sum of Distances in a Tree

Try to solve the Sum of Distances in a Tree problem.

Statement

Given a connected, undirected tree with n nodes, labeled from 00 to n1n - 1, and n1n - 1 edges. The edges are provided in an array, where each element edges[i] =[ai,bi]= [a_i, b_i] ...