Java || PriorityQueue Approach
\nclass Solution {\n    public int largestSumAfterKNegations(int[] nums, int k) {\n        PriorityQueue<Integer> pq = new PriorityQueue<>();\n        for(int p
```\nclass Solution {\n    public int largestSumAfterKNegations(int[] nums, int k) {\n        PriorityQueue<Integer> pq = new PriorityQueue<>();\n        for(int p : nums){\n            pq.offer(p);\n        }\n        while(k --> 0){\n            int temp = pq.poll();\n            temp = -temp;\n            pq.offer(temp);\n        }\n        int sum = 0;\n        while(!pq.isEmpty()){\n            sum += pq.poll();\n        }\n        return sum;\n    }\n}\n```
['Sorting', 'Heap (Priority Queue)', 'Java']