C++ || Brute-force || just find out left and right palindromic numbers
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\nbool solve(int val)\n{\n    string st=to_string(val);\n    string ab=st;\n    reverse(ab.begin(),ab.end());\n    if(st==ab)\n    {\n        return true;\n    }\n    else return false;\n}\n    long long minimumCost(vector<int>& nums) {\n        int n=nums.size();\n        sort(nums.begin(),nums.end());\n        int mid=nums[(n-1)/2];\n        int inc=mid;\n        int dcr=mid;\n        while(solve(inc)==false)\n        {\n            inc++;\n        }\n        //\n         while(solve(dcr)==false)\n        {\n            dcr--;\n        }\n        long long int ans1=0;\n        long long int ans2=0;\n        for(int i=0;i<n;i++)\n        {\n            ans1+=(abs(inc-nums[i]));\n            ans2+=(abs(dcr-nums[i]));\n        }\n        return min(ans1,ans2);\n    }\n};\n```
['Sorting', 'C++']