CPP || Easy Solution || 27 ms || 97%beats|| O(1) space || O(N) time
Intuition\n Describe your first thoughts on how to solve this problem. \nThe intuition is simple we have to make the string palindrome which is our first priori
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe intuition is simple we have to make the string palindrome which is our first priority so simply i can check that it is palindrom or not and second task is that it should be Lexicographically Smallest Palindrome so when the string palindrom condition fails we can simply swap the largest amongst the two of them with the smallest\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nI have used a simple loop and basic string palindrom checking condition that if s[i]!=s[s.size()-i-1] means there the string is different so we will compare if s[i] is smaller than s[s.size()-i-1] then we will set s[s.size()-i-1] as s[i] otherwise s[s.size()-i-1] is smaller that s[i] then s[i]= s[s.size()-i-1]\n\n# Complexity\n- Time complexity: $$O(N)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string makeSmallestPalindrome(string s) {\n        for(int i= 0 ; i < s.size() ;i++)\n        {\n            if(s[i]!=s[s.size()-1-i])\n            {\n                if(s[i]<s[s.size()-1-i])\n                {\n                    s[s.size()-1-i] = s[i];\n                }\n                else\n                {\n                    s[i] = s[s.size()-1-i];\n                }\n            }\n        }\n        return s;\n    }\n    \n};\n```
['String', 'C++']