Go "brute force" solution to find the closest palindromes to median
Minimum Cost to Make Array Equalindromic: like all problems where we want to make the elements equal we need to find the median first; and make all element matc
Minimum Cost to Make Array Equalindromic: like all problems where we want to make the elements equal we need to find the median first; and make all element match it. Since this problem specifically requires a palindrome; we need the one that is closest to the median. 
But if we find one from one end (incremeting or decremeting); We are not guaranteed to find the optimal solution since we do not know which one gives a better cost thus we just try both the lowerEndClosest and upperEndClosest palindrome.

I don't know the furthest gap between a number X and its closest palindrome so cannot tell exactly the time complexity of finding the closest palindromes. 
But if you want a more efficient way, this by itself would be a hard problem: https://leetcode.com/problems/find-the-closest-palindrome/description/

# Code
```golang []
func minimumCost(nums []int) int64 {
	// find the median
	sort.Ints(nums)
	idx := len(nums) / 2
	median := nums[idx]

	// get closest palindromes to median
	lowerEnd, uppedEnd := -1, -1
	for i := 0; lowerEnd == -1 || uppedEnd == -1; i++ {
		if lowerEnd == -1 && isPalindrome(median-i) {
			lowerEnd = median - i
		}
		if uppedEnd == -1 && isPalindrome(median+i) {
			uppedEnd = median + i
		}
	}

	// calculate the cost
	costLowerEnd, costUppedEnd := int64(0), int64(0)
	for _, num := range nums {
		costLowerEnd += int64(abs(num - lowerEnd))
		costUppedEnd += int64(abs(num - uppedEnd))
	}
	return min(costLowerEnd, costUppedEnd)
}

func isPalindrome(num int) bool {
	rev, cpnum := 0, num
	for ; cpnum > 0; cpnum /= 10 {
		rev = rev*10 + cpnum%10
	}
	return num == rev
}

func abs(num int) int {
	if num < 0 {
		return -num
	}
	return num
}
```
['Go']