[Javascript] Greedy w/ Sorting
Solution: Greedy w/ Sorting\n\nThe first mouse should always take the k cheese with the maximum difference (reward1[i] - reward2[i]).\nThis ensures the loss is 
**Solution: Greedy w/ Sorting**\n\nThe first mouse should always take the `k` cheese with the maximum difference (`reward1[i] - reward2[i]`).\nThis ensures the loss is minimal.\n\nTime Complexity: `O(n log(n))`\nSpace Complexity: `O(n)`\n```\nvar miceAndCheese = function(reward1, reward2, k) {\n  let n = reward1.length, rewards = [];\n  for (let i = 0; i < n; i++) {\n    rewards.push([reward1[i], reward2[i], reward1[i] - reward2[i]]);\n  }\n  rewards.sort((a, b) => b[2] - a[2]);\n  let score = 0;\n  for (let i = 0; i < n; i++) {\n    score += i < k ? rewards[i][0] : rewards[i][1];\n  }\n  return score;\n};\n```
['JavaScript']