java beats 100%
Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n\nclass Solution {\n    public String makeSmallestPalindrome(String s) {\n        c
# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\n    public String makeSmallestPalindrome(String s) {\n        char[] chars = s.toCharArray();\n        int l = 0;\n        int r = chars.length - 1;\n\n        while (l < r) {\n            int min = Math.min(chars[l], chars[r]);\n            chars[l++] = chars[r--] = (char)min;\n        }\n\n        return new String(chars);\n    }\n\n}\n```
['Java']