My C++ Soln | Easy and Understandable | Priority Queue
\n\tint nthUglyNumber(int n) {\n        priority_queue<long long, vector<long long>, greater<long long> >q;\n        q.push(1);\n        long long prev;\n      
```\n\tint nthUglyNumber(int n) {\n        priority_queue<long long, vector<long long>, greater<long long> >q;\n        q.push(1);\n        long long prev;\n        for(int i=0; i<n; i++) {\n            prev = q.top();\n            q.push(prev*2);\n            q.push(prev*3);\n            q.push(prev*5);\n            while(q.top()==prev)\n                q.pop();\n        }\n        return prev;\n    }\n```
[]