You are viewing a single comment's thread. Return to all comments →
Java solution
public static int migratoryBirds(List<Integer> arr) { var groups = arr.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); return groups.entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey).orElse(0); }
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
Java solution