Beats 100% Solutions
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\n/**\n * @param {string} s\n * @return {string}\n */\nvar makeSmallestPalindrome = function(s) {\n    \n     let rev = s.split("").reverse().join("");\n        let str = \'\';\n\n        for(let i = 0 ; i < s.length ; i++)\n            {\n                const item1 = s[i];\n                const item2 = rev[i];\n\n                if( item1 === item2 )\n                {\n                    str += item1;\n                }\n                else\n                {\n                    if(s.charCodeAt(i) < rev.charCodeAt(i))\n                    {\n                        str += item1;\n                    }\n                    else\n                    {\n                        str += item2;\n                    }\n                }\n            }\n    return str;\n    \n};\n```
['JavaScript']