[Java/C++/Python] Two Pointers
Explanation\nCompare each s[i] with its symmetrical postion in palindrome,\nwhich is s[n - 1 - i].\n\nTo make the lexicographically smallest palindrome,\nwe mak
# **Explanation**\nCompare each `s[i]` with its symmetrical postion in palindrome,\nwhich is `s[n - 1 - i]`.\n\nTo make the lexicographically smallest palindrome,\nwe make `s[i] = s[n - 1 - i] = min(s[i], s[n - i - 1])`\n<br>\n\n# **Complexity**\nTime `O(n)`\nSpace `O(n)`\n<br>\n\n**Java**\n```java\n    public String makeSmallestPalindrome(String s) {\n        int n = s.length();\n        StringBuilder sb = new StringBuilder();\n        for (int i = 0; i < n; i++)\n            sb.append(Character.toString(Math.min(s.charAt(i), s.charAt(n - i - 1))));\n        return sb.toString();\n    }\n```\n\n**C++**\n```cpp\n    string makeSmallestPalindrome(string s) {\n        int n = s.size();\n        for (int i = 0; i < n; ++i)\n            s[i] = s[n - 1 - i] = min(s[i], s[n - i - 1]);\n        return s;\n    }\n```\n\n**Python**\n```py\n    def makeSmallestPalindrome(self, s: str) -> str:\n        return \'\'.join(map(min, zip(s, s[::-1])))\n```\n
['C', 'Python', 'Java']