there undirecte connected tree n node label 0 n 1 n 1 edgesYou give integer n array edge edgesi ai bi indicate edge node ai bi treeReturn array answer length n answeri sum distance ith node tree nod Example 1input n 6 edge 0102232425output 8126101010explanation the tree show aboveWe dist01 dist02 dist03 dist04 dist05equal 1 1 2 2 2 8hence answer0 8 onexample 2input n 1 edge output 0example 3input n 2 edge 10output 11 Constraints1 n 3 104edgeslength n 1edgesilength 20 ai bi nai biThe give input represent valid tree