Super Easy || C++
Code\n\nclass Solution \n{\npublic:\n    bool isPalin(long long num)\n    {\n        string s=to_string(num);\n        long long n=s.size();\n        for(long l
# Code\n```\nclass Solution \n{\npublic:\n    bool isPalin(long long num)\n    {\n        string s=to_string(num);\n        long long n=s.size();\n        for(long long x=0; x<n/2; x++)\n        {\n            if(s[x]!=s[n-x-1]) return false;\n        }\n        return true;\n    }\n    long long minimumCost(vector<int>& nums) \n    {\n        sort(nums.begin(),nums.end());\n        long long n=nums.size();\n        long long mid=nums[n/2];\n        if(isPalin(mid))\n        {\n            long long ans=0;\n            for(auto it: nums) ans+=abs(it-mid);\n            return ans;\n        }\n        long long a=mid, b=mid;\n        while(!isPalin(a)) a--;\n        while(!isPalin(b)) b++;\n        long long asum=0, bsum=0;\n        for(auto it: nums) asum+=abs(it-a);\n        for(auto it: nums) bsum+=abs(it-b);\n        return min(asum,bsum);\n    }\n};\n```
['C++']