evantianx / CodeWars-Haskell

0 stars 0 forks source link

Detect Pangram #10

Open evantianx opened 5 years ago

evantianx commented 5 years ago

A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence The quick brown fox jumps over the lazy dog is a pangram, because it uses the letters A-Z at least once (case is irrelevant).

Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation.

evantianx commented 5 years ago

Solutions

import Data.Char

isPangram :: String -> Bool
isPangram str = all (`elem` (map toLower str)) ['a'..'z']
import Data.Char
import Data.List

isPangram :: String -> Bool
isPangram str = null $ ['a'..'z'] \\ (map toLower str)