Simple Python heap solution
Keep negating the minimum value:\n\n\nimport heapq\n\nclass Solution(object):\n    def largestSumAfterKNegations(self, S, K):\n        heapq.heapify(S)\n       
Keep negating the minimum value:\n\n```\nimport heapq\n\nclass Solution(object):\n    def largestSumAfterKNegations(self, S, K):\n        heapq.heapify(S)\n        for _ in range(K):\n            v = heapq.heappop(S)\n            heapq.heappush(S, -v)\n        return sum(S)\n```
['Python']