Skip to content

Instantly share code, notes, and snippets.

@arsho
Last active August 17, 2016 13:01
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 arsho/68b9b6ffbfc382ae643d65011d09f479 to your computer and use it in GitHub Desktop.
Save arsho/68b9b6ffbfc382ae643d65011d09f479 to your computer and use it in GitHub Desktop.
<?php
$_fp = fopen("php://stdin", "r");
while($line=fgets($_fp)){
$line = strtolower($line);
$line_length = strlen($line);
$char_ar=array();
for ($i=0;$i<$line_length;$i++){
$current_char = $line[$i];
if(preg_match('/^[a-z]$/',$current_char)){
$char_ar[$current_char] = 1;
}
if(count($char_ar)==26) {
break;
}
}
if(count($char_ar)==26){
echo "pangram";
}
else{
echo "not pangram";
}
}
fclose($_fp);
?>
@arsho
Copy link
Author

arsho commented Aug 17, 2016

Python Solution

s = input().lower()
if len([x for x in list(set(s)) if x.isalpha()])==26:
    print("pangram")
else:
    print("not pangram")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment