simple and easy C++ solution
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\ncpp []\nclass Solution 
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int largestSumAfterKNegations(vector<int>& nums, int k) \n    {\n        priority_queue<int, vector<int>, greater<int>>minHeap;\n        for(auto val:nums) minHeap.push(val);\n\n        while(k--)\n        {\n            int val = minHeap.top();\n            minHeap.pop();\n            minHeap.push(-val);\n        }\n\n        int maxSum = 0;\n        while(!minHeap.empty())\n        {\n            maxSum += minHeap.top();\n            minHeap.pop();\n        }\n        return maxSum;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'Heap (Priority Queue)', 'C++']