Simplest Python Solution || Heap
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def largestSumAfterKNegations(self, nums: List[int], k: int) -> int:\n        heapq.heapify(nums)\n        for i in range(len(nums)):\n            if k==0:break\n            cur=heapq.heappop(nums)\n            if cur<0:\n                cur=abs(cur)\n                heapq.heappush(nums,cur)\n                k-=1\n            elif cur>=0:\n                heapq.heappush(nums,cur)\n                break\n        while True:\n            if k>0:\n                cur=-heapq.heappop(nums)\n                heapq.heappush(nums,cur)\n                k-=1\n            else:break\n        # print(nums)\n        return sum(nums)\n\n```
['Heap (Priority Queue)', 'Python3']