C++ solution
\nclass Solution {\npublic:\n    int largestSumAfterKNegations(vector<int>& A, int K) {\n        priority_queue<int, vector<int>, greater<int>> pq(A.begin(), A.
```\nclass Solution {\npublic:\n    int largestSumAfterKNegations(vector<int>& A, int K) {\n        priority_queue<int, vector<int>, greater<int>> pq(A.begin(), A.end());\n        while (K--) {\n            int x = pq.top();\n            pq.pop();\n\n            pq.push(-1 * x);\n        }\n        int res = 0;\n        while (!pq.empty()) {\n            res += pq.top();\n            pq.pop();\n        }\n        return res;\n    }\n};\n```\n
['C', 'C++']