C++ Solution of Super Ugly Number using Priority Queue
\n# Code\n\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        int cnt=0;\n        long long val=0;\n        priority_
\n# Code\n```\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        int cnt=0;\n        long long val=0;\n        priority_queue<long long,vector<long long>,greater<long long>> pq;\n        pq.push(1);\n        int i=0;\n        while(!pq.empty() && cnt!=n){\n           long long mx=pq.top();\n           val=mx;\n           for(int j=0;j<primes.size();j++){\n               pq.push(mx*primes[j]);\n           }\n           while(!pq.empty()&& mx==pq.top()){\n               pq.pop();\n           }\n           cnt++;\n        }\n        return val;\n\xA0\xA0\xA0\xA0}\n};\n```
['Heap (Priority Queue)', 'C++']