You are given an array of integers. You want to transform it so that every element is distinct. You may apply the following operation any number of times (including zero):
Find the minimum total cost needed to make the entire array contain only distinct elements.