C++ || Simple Prime Factorization
\nclass Solution {\npublic:\n    long long getSumOfFactors(int n)\n    {\n        int divisor = 2;\n        long long ans = 0;\n        while(n > 1)\n        {\
```\nclass Solution {\npublic:\n    long long getSumOfFactors(int n)\n    {\n        int divisor = 2;\n        long long ans = 0;\n        while(n > 1)\n        {\n            if (n % divisor == 0) \n            {\n                ans += divisor;\n                n = n / divisor;\n            }\n            else divisor++;\n        }\n        return ans;\n    }\n    int smallestValue(int n) \n    {   \n        while(true)\n        {\n            long long sumOfFactors = getSumOfFactors(n);\n            if (n == sumOfFactors) break;\n            n = sumOfFactors;\n        }\n        return n;\n    }\n};\n```
['C', 'C++']