Beginner friendly || Nice approach || i take help
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def maximumValueSum(self, nums: List[int], k: int, edges: List[List[int]]) -> int:\n        totalSum = 0\n        count = 0\n        positiveMin = float("inf")\n        negativeMax = float("-inf")\n\n        for nodeValue in nums:\n            nodeValAfterOperation = nodeValue ^ k\n\n            totalSum += nodeValue\n            netChange = nodeValAfterOperation - nodeValue\n\n            if netChange > 0:\n                positiveMin = min(positiveMin, netChange)\n                totalSum += netChange\n                count += 1\n            else:\n                negativeMax = max(negativeMax, netChange)\n\n        if count % 2 == 0:\n            return totalSum\n        return max(totalSum - positiveMin, totalSum + negativeMax)\n```
['Array', 'Dynamic Programming', 'Greedy', 'Bit Manipulation', 'Tree', 'Sorting', 'Python3']