Check closest to median
\n\n# Code\n\nclass Solution:\n    def minimumCost(self, nums: List[int]) -> int:\n        mn = int(median(nums))\n        oo = mn\n        def ok(n):\n        
\n\n# Code\n```\nclass Solution:\n    def minimumCost(self, nums: List[int]) -> int:\n        mn = int(median(nums))\n        oo = mn\n        def ok(n):\n            x = str(n)\n            return x == x[::-1]\n\n        while not ok(mn):\n            mn += 1\n        \n        while not ok(oo):\n            oo -= 1\n\n        return min(sum(abs(x-mn) for x in nums), sum(abs(x-oo) for x in nums))\n```
['Python3']