• + 0 comments

    JS solution :

    function equalizeArray(arr) {
        return arr.length - Math.max(...[...new Set(arr)].map((num, i) => arr.reduce((acc, next) => next == num ? acc + 1 : acc, 0)))
    }