Clean and concise solution
 # Intuition  \n\n\n\n\n\n\n\n\n\n\n\n\n# Code\n\nclass Solution {\npublic:\n    int largestSumAfterKNegations(vector<int>& nums, int k) {\n        sort(nums.be
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n<!-- # Complexity -->\n<!-- - Time complexity: -->\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n<!-- - Space complexity: -->\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int largestSumAfterKNegations(vector<int>& nums, int k) {\n        sort(nums.begin(), nums.end());\n        int sum = accumulate(nums.begin(), nums.end(), 0), i = 0;\n        for (; i < nums.size() and nums[i] < 0 and k > 0; i++, k--) {\n            nums[i] *= -1;\n            sum += 2 * nums[i];\n        }\n        \n        if (k % 2 == 1) {\n            sum -= 2 * min(\n                (i < nums.size()) ? nums[i] : nums[i - 1],\n                (i > 0) ? nums[i - 1] : nums[i]);\n        }\n        return sum;\n    }\n};\n```
['C++']