You are viewing a single comment's thread. Return to all comments →
Using streams -
static int migratoryBirds(List<Integer> arr) { return arr.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting())) .entrySet() .stream() .sorted(Map.Entry.<Integer, Long>comparingByValue().reversed()) .findFirst() .get() .getKey(); }
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 →
Using streams -