Python || 93.80% Faster || Iterative Approach || O(n) Solution
\nclass Solution:\n    def nthUglyNumber(self, n: int) -> int:\n        ans=[1]\n        prod_2=prod_3=prod_5=0\n        for i in range(1,n):\n            a=ans
```\nclass Solution:\n    def nthUglyNumber(self, n: int) -> int:\n        ans=[1]\n        prod_2=prod_3=prod_5=0\n        for i in range(1,n):\n            a=ans[prod_2]*2\n            b=ans[prod_3]*3\n            c=ans[prod_5]*5\n            m=min(a,b,c)\n            ans.append(m)\n            if m==a:\n                prod_2+=1\n            if m==b:\n                prod_3+=1\n            if m==c:\n                prod_5+=1\n        return ans[-1]\n```\n\n**Upvote if you like the solution or ask if there is any query**
['Iterator', 'Python', 'Python3']