C++ | simple approach |easy understanding|😎
```\nclass Solution {\npublic:\n    int miceAndCheese(vector& r1, vector& r2, int k) {\n        priority_queue> >pq;\n        int n =r1.size();\n        unorder
```\nclass Solution {\npublic:\n    int miceAndCheese(vector<int>& r1, vector<int>& r2, int k) {\n        priority_queue<pair<int,pair<int,int>> >pq;\n        int n =r1.size();\n        unordered_set<int> st;\n        for(int i=0;i<n;i++){\n\t\t     //based on the diff we are sorting in decreasing order\n            pq.push({r1[i]-r2[i],{r1[i],i}});\n                \n        }\n        int ans =0;\n       \n        while(k && !pq.empty()){\n\t\t\t\t//take k max elements having more difference\n            ans += pq.top().second.first;\n\t\t\t//mark the index as selected\n            st.insert(pq.top().second.second);\n            pq.pop();\n            k--;\n        }\n       \n        for(int i=0;i<n;i++){\n\t\t\t//if the index is not selected then 2nd mice will take the reward\n          if(!st.count(i)){\n              ans += r2[i];\n          }\n        }\n        return ans;\n        \n    }\n};
['C', 'Heap (Priority Queue)']