• + 0 comments
    function equalizeArray(arr) {
        let freq = {}; 
        
        for(let n of arr) {
            freq[n] = (freq[n] || 0 ) + 1; 
        }
        
        let maxFreq = Math.max(...Object.values(freq)); 
        
        return arr.length - maxFreq; 
    }
    // Be Happy and Code every day !!