C++ || Easiest 4 lines of code
Here is my c++ code for this problem.\n\n# Complexity\n- Time complexity:O(n/2)\n\n- Space complexity:O(1)\n\n# Code\n\nclass Solution {\npublic:\n    string ma
Here is my c++ code for this problem.\n\n# Complexity\n- Time complexity:$$O(n/2)$$\n\n- Space complexity:$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    string makeSmallestPalindrome(string s) {\n        for(int i=0; i<s.size()/2; i++){\n            if(s[i]!=s[s.size()-1-i]){\n                (s[i]<s[s.size()-1-i])?s[s.size()-1-i]=s[i]:s[i]=s[s.size()-1-i];\n            }\n        }\n        return s;\n    }\n};\n```
['String', 'C++']