[Java] Straightforward Priority Queue
\nclass Solution {\n    public int largestSumAfterKNegations(int[] A, int K) {\n        PriorityQueue<Integer> pq = new PriorityQueue<>();\n        for (int x :
```\nclass Solution {\n    public int largestSumAfterKNegations(int[] A, int K) {\n        PriorityQueue<Integer> pq = new PriorityQueue<>();\n        for (int x : A) {\n            pq.offer(x);\n        }\n        while (K > 0) {\n            pq.offer(-pq.poll());\n            K--;\n        }\n        return pq.stream().mapToInt(i -> i).sum();\n    }\n}\n```
[]