There is an undirected tree with edges of length edges[i]
A node is considered good if all subtrees rooted at its children have the exact same size.
Return the total number of good nodes in the given tree.
Note: A subtree of a node includes that child node and all of its descendants. Any leaf node is also considered a good node since it has
children.
Constraints:
edges.length
edges[i].length
The input is generated such that edges represents a valid tree.
There is an undirected tree with edges of length edges[i]
A node is considered good if all subtrees rooted at its children have the exact same size.
Return the total number of good nodes in the given tree.
Note: A subtree of a node includes that child node and all of its descendants. Any leaf node is also considered a good node since it has
children.
Constraints:
edges.length
edges[i].length
The input is generated such that edges represents a valid tree.