Pure & Raw Python (no libraries)
\nclass Solution(object):\n    def nthSuperUglyNumber(self, n, primes):\n        """\n        :type n: int\n        :type primes: List[int]\n        :rtype: int
```\nclass Solution(object):\n    def nthSuperUglyNumber(self, n, primes):\n        """\n        :type n: int\n        :type primes: List[int]\n        :rtype: int\n        """\n        pcnt = len(primes)\n        uglies = [0]*n\n        uglies[0] = 1\n        divs = [0] * pcnt\n        for i in range(1, n):\n            uglies[i] = primes[0] * uglies[divs[0]]\n            for k in range(1, pcnt):\n                new = primes[k] * uglies[divs[k]]\n                if uglies[i] > new:\n                    uglies[i] = new\n            for j in range(pcnt):\n                divs[j] += uglies[i] == uglies[divs[j]] * primes[j]\n        return uglies[-1]\n```
['Python']