C++ || O(N) || DP || TABULAR APPROACH || With Explaination || Very Easy
\n\tclass Solution {\n\tpublic:\n    int nthUglyNumber(int n) {\n\t\n        //since the count of numbers to be added is upto n, the vector will contain max n n
\n\tclass Solution {\n\tpublic:\n    int nthUglyNumber(int n) {\n\t\n        //since the count of numbers to be added is upto n, the vector will contain max n numbers\n        vector<int> ans(n);\n        \n        // x==>pointer to index to which 2 will be multiplied;\n        // y==>pointer to index to which 3 will be multiplied;\n        // z==>pointer to index to which 5 will be multiplied;\n\t\t\n\t\t//all x,y,z poniters will start multiplication right from 0th index\n\t\t\n        int x=0,y=0,z=0;\n        ans[0]=1;\n        for(int i=1;i<n;i++)\n        {\n            ans[i]=min(ans[x]*2,min(ans[y]*3,ans[z]*5));\n            if(ans[i]==2*ans[x])x++;\n            if(ans[i]==3*ans[y])y++;\n            if(ans[i]==5*ans[z])z++;\n            \n            // when ans == value to which more than one pointers among (x,y,z) point, all pointers get increamented\n        }\n        return ans[n-1];//last index contains the number of nth count\n    }\n};\n\n**Please upvote if this helped! **
['Dynamic Programming', 'C', 'C++']