C++ || SET STL solution
\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        set<long> possible,fix;\n        possible.insert(1);\n        whi
```\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        set<long> possible,fix;\n        possible.insert(1);\n        while(fix.size()!=n){\n            long nextUgly = *possible.begin();\n            fix.insert(nextUgly);\n            possible.erase(nextUgly);\n            for(int i=0; i<primes.size();i++){\n                possible.insert(primes[i]*nextUgly);\n            }\n        }\n        return *fix.rbegin();\n    }\n};\n```
['C', 'Ordered Set', 'C++']