✅ C++ EZ Greedy Solution using Priority Queue✅
Approach : \nIts mentioned in the question that mice 1 will need to select \'k\' cheese and mice  2 can select the remaining cheese. We need to select the \'k\'
Approach : \nIts mentioned in the question that mice 1 will need to select \'k\' cheese and mice  2 can select the remaining cheese. We need to select the \'k\' cheese in such a way that the reward will be maximum.\nI am using a priority queue **<difference between reward1[i] and reward2[i], reward1[i], reward2[i]>**\nBy default the heap will be created based on the first element. It can be said that whenever we select reward1 \'k\' times, the one with maximum difference will be optimal.\nSo we select the first \'k\' elements from reward1 and then the remaining elements from reward2 will give us the optimal answer.\n\n**Time Complexity : O(N * log (N) )\nSpace Complexity : O(N)**\n\n```\nclass Solution {\npublic:\n    int miceAndCheese(vector<int>& reward1, vector<int>& reward2, int k) {\n        int x=0;      \n        int len=reward1.size();\n          priority_queue<vector<int>>q;        \n        for(int i=0;i<len;i++)            \n            q.push({reward1[i]-reward2[i],reward1[i],reward2[i]});\n        while(!q.empty()&&k--){\n            x=x+q.top()[1];\n            //cout<<x" ";\n            q.pop();\n        }        \n        while(!q.empty()){\n             x=x+q.top()[2];\n            q.pop();\n        }        \n        return x;\n    }\n};\n```
['Greedy', 'C', 'Sorting', 'Heap (Priority Queue)', 'C++']