We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Migratory Birds
Migratory Birds
Sort by
recency
|
3638 Discussions
|
Please Login in order to post a comment
}
Clean problem — reminds me of how I categorized menu items by popularity on the Popeyes menu site. Here's my Python take using Counter:
TypeScript:
Java
public static int migratoryBirds(List arr) {
int max=0; for(int key:map.keySet()){ if(map.get(key)>max){ max=map.get(key); } } ArrayList list = new ArrayList<>(); for(int key:map.keySet()){ if(map.get(key)==max){ list.add(key); } } Collections.sort(list); return list.get(0); }