Intel Corporation Interview Question

Given an array, calculate the minimum cost of modifying all elements to a single number.