Simple Java Solution | Stream API
\n    public int largestSumAfterKNegations(int[] nums, int k) {\n\n        var minHeap = new PriorityQueue<Integer>(Arrays.stream(nums).boxed().toList());\n    
```\n    public int largestSumAfterKNegations(int[] nums, int k) {\n\n        var minHeap = new PriorityQueue<Integer>(Arrays.stream(nums).boxed().toList());\n        \n        IntStream.range(0, k).forEach(i -> minHeap.add(-minHeap.remove()));\n        \n        return minHeap.stream().reduce(0, (intermediateResult, num) -> intermediateResult + num);\n    }\n```
['Heap (Priority Queue)', 'Java']