Priority queue || C++ || Max-heap || Easy-Understanding || Simple
\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {\n        vector<int> ans;\n        
```\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {\n        vector<int> ans;\n        priority_queue<int> pq;\n        unordered_map<int,int> mp;\n        for(int i=0;i<potions.size();i++)\n            pq.push(potions[i]);\n        vector<int> spells1=spells;\n        sort(spells.begin(),spells.end());\n        int cnt=0;\n        for(int i=0;i<=spells.size()-1;i++)\n        {\n            while(!pq.empty())\n            {\n                int x=pq.top();\n                if((long long) x* (long long) spells[i]>=success) {cnt++; pq.pop();}\n                else\n                  break;\n            }\n            mp[spells[i]]=cnt;\n        }\n        for(int i=0;i<spells.size();i++)\n        {\n            ans.push_back(mp[spells1[i]]);\n        }\n        return ans;\n    }\n};\n```
['C', 'Heap (Priority Queue)', 'C++']