Created
November 4, 2014 18:00
-
-
Save shoooe/3e9bc661cba4d6b15f67 to your computer and use it in GitHub Desktop.
A solution to a problem (https://www.hackerrank.com/challenges/pangrams) someone (http://chat.stackoverflow.com/transcript/message/19783858#19783858) asked me to solve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Char (toLower) | |
isPangram :: String -> Bool | |
isPangram s = | |
let ls = map (toLower) s | |
in null . filter (not . (`elem` ls)) $ ['a'..'z'] | |
main :: IO () | |
main = do | |
s <- getLine | |
if isPangram s | |
then putStrLn "pangram" | |
else putStrLn "not pangram" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment