Easy to Understand Java Code || Beats 100%
Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n\nclass Solution {\n    public String makeSmallestPalindrome(String s) {\n        char[
# Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n```\nclass Solution {\n    public String makeSmallestPalindrome(String s) {\n        char[] c = s.toCharArray();\n        int i = 0, j = s.length()-1;\n\n        while(i < j){\n            if(c[i]  <c[j]){\n                c[j--] = c[i++];\n            }else {\n                c[i++] = c[j--];\n            }\n        }\n        return new String(c);\n    }\n}\n```
['Java']