Fast and short, but not necessarily readable Python
Code\n\nclass Solution(object):\n    def minimumCost(self, ns):\n        ns.sort()\n        mm = ns[len(ns) // 2]\n        return min(sum(map(lambda nn: abs(nn 
# Code\n```\nclass Solution(object):\n    def minimumCost(self, ns):\n        ns.sort()\n        mm = ns[len(ns) // 2]\n        return min(sum(map(lambda nn: abs(nn - x), ns)) for x in [self.iterate(mm, +1), self.iterate(mm, -1)])\n\n    def iterate(self, n0, dn):\n        n = n0\n        while not str(n) == str(n)[::-1]:\n            n += dn\n        return n\n```
['Python3']