[C++] Clean & Concise Solution
Approach\nThe approach is very similar to Ugly Number II\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity: O(n * k)\n Add yo
# Approach\nThe approach is very similar to Ugly Number II\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n * k)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n * k)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\ntypedef long long ll;\nclass Solution {\npublic:\n    int nthSuperUglyNumber(int n, vector<int>& primes) {\n        int k = primes.size();\n        vector<ll> pos(k, 0), res(n);\n        res[0] = 1;\n        for (int i = 1; i < n; i++) {\n            ll temp = 4e10;\n            for (int j = 0; j < k; j++) \n                temp = min(temp, res[pos[j]] * primes[j]);\n            for (int j = 0; j < k; j++)\n                pos[j] += temp == res[pos[j]] * primes[j];\n            res[i] = temp;\n        }\n        return res[n - 1];\n    }\n};\n```
['C++']