C++, 68ms Solution
elmt[i] represents (i+1)th ugly number\nptr[i] represents pointer ith prime factor. Think of this, lets assume we have found 7 using 7x1 and we don\'t want 7x1 
elmt[i] represents (i+1)th ugly number\nptr[i] represents pointer ith prime factor. Think of this, lets assume we have found 7 using 7x1 and we don\'t want 7x1 again so we increase the pointer of 7 by 1. Next time if we need a 7 to multiply , we will multiply with minimum number greater than 1. i.e our pointer will point to required element. 7x2 in this case.\nFor example, [2,7,13,19]\nEverytime we try to multiply 2,7,13,19 with previous some element to get new multiple in ascending order.\nHere are all the multiples using prime factors:\n```\n2^0 7^0 13^0 19^0   = 1\n2^1 7^0 13^0 19^0   = 2\n2^2 7^0 13^0 19^0   = 4\n2^0 7^1 13^0 19^0   = 7\n2^3 7^0 13^0 19^0   = 8\n2^0 7^0 13^1 19^0   = 13\n2^1 7^1 13^0 19^0   = 14\n.\n.\n.\n\n\n```\n\n```\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        if(n==1 ) return 1;\n        \n        vector<int> ptr(primes.size(),0);\n        vector<int> elmt(n,0);\n        elmt[0]=1;\n        int t;        \n        for(int i=1; i<n ; i++){\n            int mini=INT_MAX;\n            int idx=0;\n            for(int j=0; j<primes.size(); j++){\n                t=primes[j]*elmt[ptr[j]];\n                if(t<mini){\n                    mini=t;\n                    idx=j;\n                }\n            }\n            for(int j=0; j<primes.size(); j++){\n                if(mini==primes[j]*elmt[ptr[j]]){\n                    ptr[j]++;\n                }\n            }\n            elmt[i]=mini;\n        }\n        return elmt[n-1];\n        \n    }\n};\n```
['C']