Beginner-friendly solution using C++ || Greedy || Clear
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 
# 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: O(nlogn)\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\n        for (int i = 0; i < nums.size(); i++)\n            if (nums[i] < 0 && k > 0)\n            {\n                nums[i] = -nums[i];\n                k--;\n            }\n\n        sort(nums.begin(), nums.end());\n        if (k & 1)\n            nums[0] = -nums[0];\n\n        return accumulate(nums.begin(), nums.end(), 0);\n    }\n};\n```
['C++']