Two Nearest Palindromes to median on its' either side ||  Simple and easy to understand
JUST TRAVEL ON BOTH SIDES OF MEDIAN AND FIND FIRST ENCOUNTERED PALINDROME.\nRETURN THE MINIMUM ANSWER AFTER ASKED PERFORMING CALCULATION.\n\n\n#define ll long l
JUST TRAVEL ON BOTH SIDES OF MEDIAN AND FIND FIRST ENCOUNTERED PALINDROME.\nRETURN THE MINIMUM ANSWER AFTER ASKED PERFORMING CALCULATION.\n\n```\n#define ll long long\nclass Solution {\n    private:\n    bool check(int num){\n        string s=to_string(num);\n        if(s.length()==1) return true;\n        else{\n            int i=0,j=s.length()-1;\n            while(i<j){\n                if(s[i]==s[j]){\n                    i++;j--;\n                }\n                else return false;\n            }\n        }\n        return true;\n        \n    }\npublic:\n    long long minimumCost(vector<int>& nums) {\n        ll n=nums.size();\n        sort(nums.begin(),nums.end());\n        ll a=0,b=0;\n        ll i=nums[n/2];\n        \n        while(i){\n            if(check(i)){\n                a=i;\n                break;\n            }\n            i--;\n        }\n        i=nums[n/2];\n        while(i){\n            if(check(i)){\n                b=i;\n                break;\n            }\n            i++;\n        }\n       cout<<nums[n/2]<< " "<< a<<" "<<b<<endl;\n        ll ans=0; ll fans=LONG_MAX; ll anss=0;\n        \n        for(int x=0;x<n;x++){\n            ans+=(abs(nums[x]-a));\n            \n        }\n        for(int x=0;x<n;x++){\n            anss+=(abs(nums[x]-b));\n            \n        }\n        \n        return min(ans,anss);\n    }\n};\n```\n\n
['C']