C++ || Easy Understanding
\nint nthUglyNumber(int n)\n    {\n        vector<int> res(1, 1);\n        int i = 0, j = 0, k = 0;\n        while(res.size() < n)\n        {\n            res.p
```\nint nthUglyNumber(int n)\n    {\n        vector<int> res(1, 1);\n        int i = 0, j = 0, k = 0;\n        while(res.size() < n)\n        {\n            res.push_back(min(res[i] * 2, min(res[j] * 3, res[k] * 5)));\n            if(res.back() == res[i] * 2)\n                i++;\n            if(res.back() == res[j] * 3)\n                j++;\n            if(res.back() == res[k] * 5)\n                k++;\n        }\n        \n        return res[n - 1];\n    }\n```
['C', 'C++']