Pangram
This commit is contained in:
parent
fee5c1afe4
commit
a62c22030e
4 changed files with 38 additions and 1 deletions
14
src/Pangram.php
Normal file
14
src/Pangram.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
function isPangram(string $input): bool
|
||||
{
|
||||
$split = str_split($input);
|
||||
$lower = array_map('strtolower', $split);
|
||||
$filtered = array_filter($lower, fn(string $letter) => $letter != ' ');
|
||||
|
||||
return count(array_unique($filtered)) == 26;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue