Python easy to come up solution with Priority Queue
\nfrom heapq import *\n\nclass Solution(object):\n    def nthUglyNumber(self, n):\n        h = [1]\n        i = 0\n        s = set()\n        while i < n:\n    
```\nfrom heapq import *\n\nclass Solution(object):\n    def nthUglyNumber(self, n):\n        h = [1]\n        i = 0\n        s = set()\n        while i < n:\n            e = heappop(h)\n            if e not in s:\n                s.add(e)\n                heappush(h, e*2)\n                heappush(h, e*3)\n                heappush(h, e*5)\n                i += 1\n        return e\n```\nOf course, not an optimized solution but it is something you can easily come up with and code fast during the interview.
[]