Input: R = 1, K = 0, N = 7, Edges[][] = {{1, 2, 3}, {1, 3, 1}, {2, 4, 3}, {2, 5, 4}, {3, 6, 1}, {3, 7, 2}}
Output: 2
Explanation:
Representation of the given Binary Tree:
The following pair of nodes have a Bitwise XOR of edges in the path connecting them as K = 0:
Pair 1: (1, 4) = (3 ^ 3) = 0
Pair 2: (1, 6) = (1 ^ 1) = 0
Input: R = 1, K = 0, N = 9, Edges[][] = {{1, 2, 3}, {1, 3, 2}, {2, 4, 3}, {2, 5, 4}, {3, 6, 1}, {3, 7, 2}, {6, 8, 3}, {6, 9, 7}}
Output: 3
Explanation:
The representation of given Binary Tree is as follows:
The following pair of nodes have a Bitwise XOR of edges in the path connecting them as K = 0:
Pair 1: (1, 4) = (3 ^ 3) = 0
Pair 2: (1, 8) = (2 ^ 1 ^ 3) = 0
Pair 3: (1, 7) = (2 ^ 2) = 0