Maximum XOR of Two Non-Overlapping Subtrees

Given a tree with n nodes labeled 0 to n-1 and n-1 undirected edges, define the size of a subtree rooted at node i as the number of nodes in it. Two subtrees are non-overlapping if neither node set contains the other (neither root is an ancestor of the other). Return the maximum XOR of the sizes of any two non-overlapping subtrees. If no such pair exists, return 0.

Examples
Input: []
Output: 0
Hints

Maximum XOR of Two Non-Overlapping Subtrees

Given a tree with `n` nodes labeled `0` to `n-1` and `n-1` undirected edges, define the size of a subtree rooted at node `i` as the number of nodes in it. Two subtrees are non-overlapping if neither node set contains the other (neither root is an ancestor of the other). Return the maximum XOR of the sizes of any two non-overlapping subtrees. If no such pair exists, return `0`.