You are viewing a single comment's thread. Return to all comments →
php solution
function migratoryBirds($arr) { $typesCount = []; foreach ($arr as $type) { if (!isset($typesCount[$type])) { $typesCount[$type] = 1; } else { $typesCount[$type]++; } } $maxAmount = max($typesCount); $typesWithMaxAmount = array_filter($typesCount, fn ($amount) => $amount === $maxAmount); $keys = array_keys($typesWithMaxAmount); return min($keys); }
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 →
php solution