Yet Another XOR Tree Problem

You are given a tree with NNN nodes. A non-negative weight is assigned to each edge of the tree.


This is a companion discussion topic for the original entry at https://toph.co/p/yet-another-xor-tree-problem