[LeetCode] Maximum XOR of Two Non-Overlapping Subtrees

1 · · Jan. 30, 2023, 12:57 p.m.
2479. Maximum XOR of Two Non-Overlapping Subtrees There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. The root of the tree is the node labeled 0. Each node has an associated value. You are given an array values of length n, where values[i] is the value of the ith node. Select any two non-overlapping subtrees. Your ...