JavaScript, Beats 99.5%
Runtime: 52 ms, faster than 99.50% of JavaScript online submissions\nMemory Usage: 35.9 MB, less than 33.80% of JavaScript online submissions\n\nTrying to take 
Runtime: 52 ms, faster than 99.50% of JavaScript online submissions\nMemory Usage: 35.9 MB, less than 33.80% of JavaScript online submissions\n\nTrying to take every short circuit I can.\n\n```javascript\n/**\n * @param {number[]} A\n * @param {number} K\n * @return {number}\n */\nconst largestSumAfterKNegations = (A, K) => {\n  A.sort((a, b) => a - b);\n  let sum = 0;\n  for (let i = 0; i < A.length; i++) {\n    let val = A[i];\n    if (0 < K) {\n      if (val < 0) {\n        let next = A[i + 1];\n        if (Math.abs(val) < next && 0 === K % 2) K = 0;\n        else [val, K] = [-val, K - 1];\n      } else if (0 !== val && 1 === K % 2) [val, K] = [-val, 0];\n      else K = 0;\n    }\n    sum += val;\n  }\n  return sum;\n};\n```\n\nAnd here is a recursive solution.\n\nRuntime: 68 ms, faster than 72.92% of JavaScript online submissions\nMemory Usage: 36.3 MB, less than 50.00% of JavaScript online submissions\n\n```javascript\n/**\n * @param {number[]} A\n * @param {number} K\n * @return {number}\n */\nconst largestSumAfterKNegations = (a, k) => {\n  if (0 === k) return a.reduce((acc, curr) => acc + curr);\n  let [min, mindex] = [Infinity];\n  for (let i = 0; i < a.length; i++) if (a[i] < min) [min, mindex] = [a[i], i];\n  if (min < 0 || k % 2) a[mindex] = -a[mindex];\n  return largestSumAfterKNegations(a, min < 0 ? k - 1 : 0);\n};\n```
['Recursion', 'JavaScript']