The equalizeArray() function takes an array of objects as input, and reduces it down to an Array of numbers. The Array of numbers is then sorted so that the numbers in the array are all greater than the number at the bottom of the list, and the array length is reduced by the number of items in the list.
function equalizeArray(arr) {
let max = 0;
let values = arr.reduce((target, value, index) => {
target[value] = (target[value] || 0) + 1;
target[value] > max && (max = target[value]);
return target;
}, []);
return arr.length - max;
}