You are viewing a single comment's thread. Return to all comments →
public static int equalizeArray(List<Integer> arr) { HashMap<Integer, Integer> ele = new HashMap<>(); for(int n : arr) ele.put(n, Collections.frequency(arr, n)); return arr.size() - Collections.max(ele.values()); }
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 →