Hackerearth-MONK AND XOR TREE

Given a tree. How to find no.of pairs (i,j) such that xor of all the weights from node i to node j equal to given k such that node i is always an ancestor to node j?

1 Like

Editorials are added you can follow

if you face any problem, let me know

The editorial provided over hackerearth is not clear