O(K*N) solution
\ndef largestSumAfterKNegations(self, A: List[int], K: int) -> int:\n        for i in range(K):\n            minv = 2**31\n            index = -1\n            f
```\ndef largestSumAfterKNegations(self, A: List[int], K: int) -> int:\n        for i in range(K):\n            minv = 2**31\n            index = -1\n            for j in range(len(A)):\n                if A[j] < minv:\n                    minv = A[j]\n                    index = j\n            if minv ==0:\n                break\n            A[index] *= -1\n        return sum(A)\n```
['Python']