A Codetikki sacred tree has an even number of nodes. Each parent-child connection is an "edge". You want to remove some edges so that the remaining disconnected subtrees each have an even number of nodes. Given a tree with an even number of nodes, return the maximum number of edges you can remove such that each remaining subtree has an even number of nodes. Input: first line n (even), then n-1 lines each with parent child.
Example 1:
Example 2:
Constraints:
2 <= n <= 10^5 (n is even) Nodes labeled 1 to n
Tags:
