Simple & Clean C++ solution (using DP)
cpp\nclass Solution {\npublic:\n    int nthUglyNumber(int n) {\n        if (n == 0) return 0;\n    \n        vector<int> dp(n, 0);\n        dp[0] = 1;\n\n      
```cpp\nclass Solution {\npublic:\n    int nthUglyNumber(int n) {\n        if (n == 0) return 0;\n    \n        vector<int> dp(n, 0);\n        dp[0] = 1;\n\n        int i2 = 0, i3 = 0, i5 = 0;\n        for (int i = 1; i < n; ++i) {\n            dp[i] = min(dp[i2] * 2, min(dp[i3] * 3, dp[i5] * 5));\n            if (dp[i] == dp[i2] * 2) ++i2;\n            if (dp[i] == dp[i3] * 3) ++i3;\n            if (dp[i] == dp[i5] * 5) ++i5;\n        }\n\n        return dp[n - 1]; \n    }\n};\n```
['C', 'C++']