You are viewing a single comment's thread. Return to all comments →
Java
Map<Integer,Long> map =arr.stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting())); Collection<Long> values= map.values(); return arr.size() - values.stream().max(Long::compare).orElse(0l).intValue();
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 →
Java