Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Last active November 12, 2020 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbvf50mobile/462279bf76f702ce3ab1115e6391c06d to your computer and use it in GitHub Desktop.
Save lbvf50mobile/462279bf76f702ce3ab1115e6391c06d to your computer and use it in GitHub Desktop.
Just PHP FUN 149.
<?php
function bingo(array $ticket, int $win): string {
$total = array_sum(array_map('small_win',$ticket));
return $total >= $win ? "Winner!" : "Loser!";
}
function small_win($x){
$chars= array_map('ord',str_split($x[0]));
return in_array($x[1],$chars) ? 1 : 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment