- https://www.codewars.com/kata/58291fea7ff3f640980000f9 Coding Meetup #8 - Higher-Order Functions Series - Will all continents be represented?
Starting at 22:10 13.10.2020 Tuesday Oct.
Finished at 22:42 13.10.2020 Tuesday Oct. (0hrs 32minutes)
<?php | |
# https://www.codewars.com/kata/58291fea7ff3f640980000f9 Coding Meetup #8 - Higher-Order Functions Series - Will all continents be represented? | |
function all_continents(array $a): bool { | |
$must_be = ['Africa', 'Americas', 'Asia', 'Europe', 'Oceania']; | |
$current_arr = array_map(function($x){ return $x['continent'];},$a); | |
$current = array_count_values($current_arr); | |
foreach($must_be as $val) if(false == isset($current[$val])) return false; | |
return true; | |
} |
Starting at 22:10 13.10.2020 Tuesday Oct.
Finished at 22:42 13.10.2020 Tuesday Oct. (0hrs 32minutes)