[C++] Straightforward Heap Solution
Complexity\n- Time complexity: O(n * log (n))\n\n- Space complexity: O(n)\n\n# Code\n\nclass Solution {\npublic:\n    int miceAndCheese(vector<int>& A, vector<i
# Complexity\n- Time complexity: $$O(n * log (n))$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int miceAndCheese(vector<int>& A, vector<int>& B, int k) {\n        priority_queue<int> pq;\n        int n = A.size(), sum = 0, res = 0;\n        for(int i = 0; i < n; i++)\n            pq.push(A[i] - B[i]), sum += B[i];\n        while(k--)\n            res += pq.top(), pq.pop();\n        return res + sum;\n    }\n};\n```
['Heap (Priority Queue)', 'C++']