Python || sort || O(n log n)
The first mice will eat exactly k types, and the second mice will eat others.\n2. Sort reward1 - reward2 in descending order. Let the first mice eat those types
1. The first mice will eat exactly `k` types, and the second mice will eat others.\n2. Sort `reward1 - reward2` in descending order. Let the first mice eat those types with highest difference.\n```\nclass Solution:\n    def miceAndCheese(self, reward1: List[int], reward2: List[int], k: int) -> int:\n        diff = [[reward1[i] - reward2[i], i] for i in range(len(reward1))]\n        diff.sort(reverse=True)\n        ans = 0\n        for i in range(k):\n            ans += reward1[diff[i][1]]\n        for i in range(k, len(reward1)):\n            ans += reward2[diff[i][1]]\n        return ans
['Python3']