best code using heap C++
class Solution {\npublic:\n    int nthUglyNumber(int n) {\n        priority_queue,greater\>pq;\n      pq.push(1);\n        long long x;\n         while(n--){\n 
class Solution {\npublic:\n    int nthUglyNumber(int n) {\n        priority_queue<long long,vector<long long>,greater<long long>>pq;\n      pq.push(1);\n        long long x;\n         while(n--){\n             if(pq.top()==x){\n                 pq.pop();\n                 n++;\n                 continue;\n             }\n            x=pq.top();\n             pq.push(2*x);\n             pq.push(3*x);\n             pq.push(5*x);\n             pq.pop();\n         }\n        return x;\n    }\n};
[]