Cpp Solution || Beginner's Friendly
Please Upvote The solution-\n\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        vector<int> vec(n,0);\n        vec[0
Please Upvote The solution-\n```\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        vector<int> vec(n,0);\n        vec[0]=1;\n        int total_primes=primes.size();\n        vector<int> pointers(total_primes,0);\n        for(int i=1;i<n;i++){\n            long long mn=INT_MAX;\n            for(int j=0;j<total_primes;j++){\n                mn=min(mn,(long long)primes[j]*(long long)vec[pointers[j]]);\n                \n            }\n            vec[i]=mn;\n            for(int j=0;j<total_primes;j++){\n                if(mn == (long long)primes[j] * (long long)vec[pointers[j]])\n                {\n                    pointers[j]++;\n                }\n            }\n        }\n        return vec[n-1];\n    }\n};\n \n```\nHappy Coding :-)
['Dynamic Programming', 'C', 'Heap (Priority Queue)', 'C++']