C++ easy solution [median]
 # Intuition  \n\n\n# Approach\n\nFind median and find 2 palindrome numbers nearest to the median and then change the entire array into any one of them which gi
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFind median and find 2 palindrome numbers nearest to the median and then change the entire array into any one of them which gives lower cost.\n\n# Complexity\n- Time complexity: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    long long minimumCost(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int med = nums[nums.size()/2];\n        long long gPali=0,sPali=0;\n        for(int i=med;i<1e9;++i){\n            string a = to_string(i);\n            string b = a;\n            reverse(a.begin(),a.end());\n            if(a==b){\n                gPali = i;\n                break;\n            }\n        }\n        for(int i=med;i>=1;--i){\n            string a = to_string(i);\n            string b = a;\n            reverse(a.begin(),a.end());\n            if(a==b){\n                sPali = i;\n                break;\n            }\n        }\n        long long ans1=0,ans2=0;\n        for(auto& ele:nums) {ans1+=abs(ele-gPali);ans2+=abs(ele-sPali);};\n        return min(ans1,ans2);\n    }\n};\n```
['C++']