If nodes are even , increment number of edges to removed . Else leave the node as child of subtree .
if ( temp % 2 ) : NEW_LINE INDENT num += temp NEW_LINE DEDENT else : NEW_LINE INDENT ans [ 0 ] += 1 NEW_LINE DEDENT return num + 1 NEW_LINE