To store changed visited values from children of this node i . e . number of nodes visited by its children
int vis = 0 ; for ( auto child : node -> children ) { vis += dfs ( child . second , ans , depth + 1 ) ; }