Python 3 || 2 lines,  maps, lambdas, and a filter || T/S: 91% / 77%
You likely can get the spirit of this solution from others\' great explications that have already been posted.\n\nclass Solution:\n    def maximumValueSum(self,
You likely can get the spirit of this solution from others\' great explications that have already been posted.\n```\nclass Solution:\n    def maximumValueSum(self, nums: List[int], k: int, \n                              edges: List[List[int]]) -> int:\n\n        dif = sorted(map(lambda x: x - (x^k), nums)) \n        \n        return sum(nums) - sum(filter(lambda x: x < 0, \n                         map(sum, zip(dif[::2],dif[1::2]))))\n```\n[https://leetcode.com/problems/find-the-maximum-sum-of-node-values/submissions/1193152707/](https://leetcode.com/problems/find-the-maximum-sum-of-node-values/submissions/1193152707/)\n\n\n\nI could be wrong, but I think that time complexity is *O*(*N*log*N*) and space complexity is *O*(*N*), in which *N* ~ `len(nums)`.
['Python3']