Simple C Solution
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\ntypedef struct {\n    long long first;\n    long long second;\n} pair;\n\nlong long maximumValueSum(int* nums, int n, int k, int** edges, int edgesSize, int* edgesColSize) {\n    pair *dp = calloc(n + 1, sizeof(pair));\n    dp[n].first = 0;\n    dp[n].second = INT_MIN;\n    for(int i = n - 1; i >= 0; i--) {\n        dp[i].first = fmax(\n            dp[i + 1].second + (nums[i] ^ k),\n            dp[i + 1].first + nums[i]\n            );\n        dp[i].second = fmax(\n            dp[i + 1].first + (nums[i] ^ k),\n            dp[i + 1].second + nums[i]\n        );\n    }\n    return dp[0].first;\n}\n```
['C']