Sponsored
Use these hints if you're stuck. Try solving on your own first.
How can we use a trie to store all the XOR values in the path from a node to the root?
How can we dynamically add the XOR values with a DFS search?
Solve with full IDE support and test cases