diff --git a/pangram.php b/pangram.php index d1acff4..5a6c467 100644 --- a/pangram.php +++ b/pangram.php @@ -7,7 +7,20 @@ function isPangram($string) { - // - // YOUR CODE GOES HERE - // + foreach (str_split($text) as $c) { + if ($c >= 'a' && $c <= 'z') + $bitset |= (1 << (ord($c) - ord('a'))); + else if ($c >= 'A' && $c <= 'Z') + $bitset |= (1 << (ord($c) - ord('A'))); + } + return $bitset == 0x3ffffff; } + +$test = array( + "the quick brown fox jumps over the lazy dog", + +); + +foreach ($test as $str) + echo "$str : ", isPangram($str) ? 'T' : 'F', '
'; + ?> \ No newline at end of file