Java - 2 solutions (Using Heap & Sorting)
Using Priority Queue :\n\nPriorityQueue<Integer> pq = new PriorityQueue<>();\nfor(int num : A) pq.add(num);\n\nwhile(K-- > 0)\n\tpq.add(-pq.poll());\n\nint sum 
Using Priority Queue :\n```\nPriorityQueue<Integer> pq = new PriorityQueue<>();\nfor(int num : A) pq.add(num);\n\nwhile(K-- > 0)\n\tpq.add(-pq.poll());\n\nint sum = 0;\nwhile(!pq.isEmpty())\n\tsum += pq.poll();\nreturn sum;\n```\n\nUsing Sorting :\n\n```\nArrays.sort(A);\nint sum = 0;\n\nfor(int i = 0; i < A.length; i++){\n\n\twhile(A[i] < 0 && K > 0){\n\t\tA[i] = -A[i];\n\t\tK--;\n\t\ti++;\n\t}\n\n\tK = K%2 == 0 ? 0 : 1;\n\tif(K > 0){\n\t\tif(i > 0 && A[i] > A[i-1])\n\t\t\tA[i-1] = -A[i-1];\n\t\telse\n\t\t\tA[i] = -A[i];\n\t}\n\tbreak;\n}\nfor(int num : A)\n\tsum += num;\nreturn sum;\n```
[]