• + 0 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());  
        }