DFS method to traverse through edges , calculating subtree Sum at each node and updating the difference between subtrees
def dfs ( u , parent , totalSum , edge , subtree , res ) : NEW_LINE INDENT Sum = subtree [ u ] NEW_LINE DEDENT