Easy C++ CODE || beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\nint  primeFactors(int n ,int  ans)\n{\n    int n1=n;\n    while (n % 2 == 0)\n    {\n        ans+=2;\n        n = n/2;\n    }\n    for (int i = 3; i <= sqrt(n); i = i + 2)\n    {\n        while (n % i == 0)\n        {\n            ans +=i;\n            n = n/i;\n        }\n    }\n \n    if (n > 2){\n        ans+=n;}\n        if(ans>=n1){\n            return n1 ;\n        }\n        else{\n            cout<<ans;\n            return primeFactors(ans,0);\n        }\n}\n    int smallestValue(int n) {\n        int ans=0;\n\n          return primeFactors( n, ans);\n        // return ans;\n    }\n};\n```
['C++']