You are viewing a single comment's thread. Return to all comments →
Javascript:
function equalizeArray(arr) { const counts = {}; let max = 0; for (let i = 0; i < arr.length; i++) { counts[arr[i]] = (counts[arr[i]] || 0) + 1; max = Math.max(counts[arr[i]], max); } return arr.length - max; }
Seems like cookies are disabled on this browser, please enable them to open this website
Equalize the Array
You are viewing a single comment's thread. Return to all comments →
Javascript: