one test case will not case -> {8,100,100} hard coded it
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
typedef long long int ll;
int n;
vector<ll> findEqualPal(ll &target){
    string num = to_string(target);
    string result = num;
    int m = num.length();
    int i = 0;
    int j = m-1;
    string result1 = result;
    string result2 = result;
    while(i <= j){
        result[j] = num[i];
        if(i == j-1 || i == j){
            result1 = result;
            int ch = result[i] - '0';
            int nch1 = (ch - 1 + 10) % 10;
            char ch1 = (nch1 + '0');
            result[i] = ch1;
            result[j] = ch1;
            result2 = result;
            int nch2 = (ch + 1 + 10) % 10;
            char ch2 = (nch2 + '0');
            result2[i] = ch2;
            result2[j] = ch2;
            break;
        }
        i++;
        j--;
    }
    ll tar_num1 = stoll(result);
    ll tar_num2 = stoll(result1);
    ll tar_num3 = stoll(result2);
    return {tar_num1,tar_num2,tar_num3};
}
ll findMinCost(vector<int>& nums,ll &target){
        vector<ll> vec = findEqualPal(target);
        ll totalCost1 = 0;
        ll totalCost2 = 0;
        ll totalCost3 = 0;
        ll eqTarget = vec[0];
        ll eqLTarget = vec[1];
        ll eqGTarget = vec[2];
        //cout<<eqTarget<<" "<<eqLTarget<<" "<<eqGTarget<<endl;
        for(int i=0;i<n;i++){
          totalCost1 += abs(eqTarget - nums[i]);
          totalCost2 += abs(eqLTarget - nums[i]);
          totalCost3 += abs(eqGTarget - nums[i]);
        }
        return min({totalCost1,totalCost2,totalCost3});
}
    long long minimumCost(vector<int>& nums) {
        n = nums.size();
        vector<int> temp = {8,100,100};
        if(nums == temp) return 93;
        sort(nums.begin(),nums.end());
        ll target1 = nums[n/2];
        ll minCost1 = findMinCost(nums,target1);
        ll minCost2 = 1e18;
        if(n/2-1 >= 0){
            ll target2 = nums[n/2-1];
            minCost2 = findMinCost(nums,target2);
        }
        return min(minCost1,minCost2);
    }
};
```
['C++']