Tree comprising N nodes, rooted at node 1.
Every node has a value 0 or 1. Initial values are provided in arr []
Some values are corrupted. Correct values in brr []
Two operations permitted:
i'th node. i.e change 0 to 1 or vice versai'th node (including i)Find minimum number of operations to change values to correct ones.
Input Format:
Example:
4
3 1
3 4
3 2
0 1 0 1
0 0 0 0Expected Output: 2
Explanation: Invert nodes 2 & 4