100% beats, C, O(n),  Gready, one additional variable to find best change to sacrifize.
Intuition\nWe actually can change any pair of nodes. Let\'s find the best value (xored or not) for all nodes, then sum them up. If the number of changed values 
# Intuition\nWe actually can change any pair of nodes. Let\'s find the best value (xored or not) for all nodes, then sum them up. If the number of changed values is odd (indicating we have a redundant change), we will sacrifice the smallest non-optimal change.\n\n\n# Code\n```\nlong long maximumValueSum(int* nums, int numsSize, int k, int** edges, int edgesSize, int* edgesColSize) {\n    long long best_solution = 0;\n    char is_changes_count_odd = 0;\n    // the smallest possible value to be subtructed if is_changes_count_odd\n    int best_to_sacrifize = abs((nums[0] ^ k) - nums[0]); // init with any(first)\n\n    for (size_t i = 0; i != numsSize; ++i) {\n        int n = nums[i];\n        // what is better? value or xored with k value?\n        if ((n ^ k) > n) {\n            is_changes_count_odd ^= 1;\n            best_solution += n ^ k;\n\n        } else {\n            best_solution += n;\n        }\n\n        // find min of all possible best_to_sacrifize\n        if ( best_to_sacrifize > abs((n ^ k) - n) ) {\n            best_to_sacrifize = abs((n ^ k) - n);\n        }\n    }\n\n    // we have one redundunt change, lets pair it one with the min sacrifize\n    // (or get rid of the less important one)\n    if (is_changes_count_odd){\n        best_solution -= best_to_sacrifize;\n    }\n    return best_solution;\n\n}\n```
['C']