python code
ApproachTwo pointer opposite directionComplexity

Time complexity:
O(N)


Space complexity:
O(N)

Code
# Approach
Two pointer opposite direction
# Complexity
- Time complexity:
$$O(N)$$

- Space complexity:
$$O(N)$$

# Code
```python3 []
class Solution:
    def makeSmallestPalindrome(self, s: str) -> str:
        # sl = list(s)
        # left=0
        # right=len(sl)-1
        # while left<right:
        #     if sl[left] != sl[right]:
        #         sl[left] = sl[right] = min(sl[left], sl[right])
        #     left+=1
        #     right-=1
        # return ''.join(sl)    
        sl = list(s)
        left=0
        right=len(sl)-1
        while left<right:
            if sl[left] != sl[right]:
                if sl[left] > sl[right]:
                    sl[left] = sl[right]
                else:
                    sl[right]=sl[left]
            left+=1
            right-=1
        return ''.join(sl)    
```
['Two Pointers', 'String', 'Python3']