Easy python solution use heap
\nclass Solution:\n    def nthSuperUglyNumber(self, n, primes):\n        """\n        :type n: int\n        :type primes: List[int]\n        :rtype: int\n      
```\nclass Solution:\n    def nthSuperUglyNumber(self, n, primes):\n        """\n        :type n: int\n        :type primes: List[int]\n        :rtype: int\n        """\n        h, heap = set([1]), [1]\n        while n:\n            a = heappop(heap)\n            for i in primes:\n                m = a * i\n                if not m in h:\n                    heappush(heap, m)\n                    h.add(m)\n            n -= 1\n        return a\n```
[]