C solution with explanation
\nint cmp(const void *a, const void *b){\n    return *(int*)a > *(int*)b;\n}\n\nint largestSumAfterKNegations(int* nums, int numsSize, int k){\n    // Sort the 
```\nint cmp(const void *a, const void *b){\n    return *(int*)a > *(int*)b;\n}\n\nint largestSumAfterKNegations(int* nums, int numsSize, int k){\n    // Sort the array first. \n    qsort(nums, numsSize, sizeof(int), cmp);\n    int i, N = numsSize, j = 0, sum = 0;\n    \n    // Concept: Flip the smallest element at each round. If it becomes larger than the next smallest element, don\'t flip it in later rounds and switch to the next element. \n    for(; k > 0; k--){  \n        nums[j] = -nums[j];\n        if(j == N - 1){\n            continue;\n        }\n        if(nums[j] > nums[j + 1]){\n            j++;\n        }\n    }\n    for(i = 0; i < N; i++){\n        sum += nums[i];\n    }\n    \n    return sum;\n}\n```
['C']