python, ruby 1-liners
ruby\n\ndef maximum_value_sum(a, k, edges) =\n\n  a.sum{ [k^_1,_1].max } - a.count{ k^_1>_1 }%2 * a.map{ (_1.-_1^k).abs }.min\n\n\npython\n\nclass Solution:\n  
ruby\n```\ndef maximum_value_sum(a, k, edges) =\n\n  a.sum{ [k^_1,_1].max } - a.count{ k^_1>_1 }%2 * a.map{ (_1.-_1^k).abs }.min\n```\n\npython\n```\nclass Solution:\n  def maximumValueSum(self, a, k, edges):\n\n    return sum( max(x,x^k) for x in a ) - sum( x^k>x for x in a )%2 * min( abs(x-(x^k)) for x in a )\n```
['Python', 'Python3', 'Ruby']