✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1 - One Line\nTime complexity: O(n). S
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1 - One Line\nTime complexity: $$O(n)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def maximumValueSum(self, a: List[int], k: int, e: List[List[int]]) -> int:\n        return (r:=reduce(lambda q,v:(q[0]+max(v,x:=v^k),min(q[1],abs(x-v)),q[2]+(x>v)),a,(0,inf,0)))[0]-r[2]%2*r[1]\n```\n\n# Code #1.2 - Unwrapped\n```\nclass Solution:\n    def maximumValueSum(self, a: List[int], k: int, e: List[List[int]]) -> int:\n        summ, minDiff, cnt = 0, inf, 0\n        for v in a:\n            x = v^k\n            summ += max(v, x)\n            minDiff = min(minDiff, abs(x-v))\n            cnt += x > v\n        \n        return summ - cnt%2*minDiff\n```\n\n(Disclaimer 2: all code above is just a product of fantasy, it is not claimed to be perfect oneliners - please, remind about drawbacks only if you know how to make it better)
['Array', 'Greedy', 'Bit Manipulation', 'Tree', 'Python', 'Python3']