- https://www.codewars.com/kata/5829ca646d02cd1a65000284 Coding Meetup #9 - Higher-Order Functions Series - Is the meetup age-diverse?
Started at 13:59 14.10.2020 Wednesday Oct.
Finished at 14:08 14.10.2020 Wednesday Oct. (0hrs 9minutes)
<?php | |
# https://www.codewars.com/kata/5829ca646d02cd1a65000284 Coding Meetup #9 - Higher-Order Functions Series - Is the meetup age-diverse? | |
function is_age_diverse(array $a): bool { | |
$a = array_values(array_unique(array_map(function($x){ return floor($x['age']/10);}, $a))); | |
sort($a); | |
for($i = 1; $i <= 9; $i += 1) if(false === array_search($i,$a)) return false; | |
if(10 > $a[count($a) - 1]) return false; | |
return true; | |
} |
Started at 13:59 14.10.2020 Wednesday Oct.
Finished at 14:08 14.10.2020 Wednesday Oct. (0hrs 9minutes)