You are given an integer array nums of length n.
In one operation, you can select any index i and replace nums[i] with a positive palindromic integer x. The cost associated with this operation is nums[i] - x
An array is defined as equalindromic if all its elements are equal to the same positive palindromic integer.
Return the minimum total cost needed to make the array nums equalindromic.
Note: A palindromic number is a positive integer that reads the same forwards and backwards.
Constraints:
n
nums[i]
You are given an integer array nums of length n.
In one operation, you can select any index i and replace nums[i] with a positive palindromic integer x. The cost associated with this operation is nums[i] - x
An array is defined as equalindromic if all its elements are equal to the same positive palindromic integer.
Return the minimum total cost needed to make the array nums equalindromic.
Note: A palindromic number is a positive integer that reads the same forwards and backwards.
Constraints:
n
nums[i]