JavaScript, beats 81.44%, 22ms
IntuitionIf we have two pointer moving inward from both ends when we encounter different characters, we choose the smaller of the two.Complexity
Time complexity
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
If we have two pointer moving inward from both ends when we encounter different characters, we choose the smaller of the two.

# Complexity
- Time complexity:$$O(n)$$
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:$$O(1)$$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {string} s
 * @return {string}
 */
var makeSmallestPalindrome = function(s) {
    let i = 0;
    let j = s.length-1;
    s = s.split('');
    
    while(i <= j) {
        if(s[i] < s[j]) {
            s[j] = s[i];
        }else {
            s[i] = s[j];
        }

        i++;
        j--;
    }

    return s.join('')
};

// abc -> aba NOT cbc

//Intuition
// if we have two pointer moving inward from both ends
// when we encounter different characters, we choose the smaller of the two to insert in the other position
```
['JavaScript']