20 lines
455 B
Elixir
20 lines
455 B
Elixir
defmodule Pangram do
|
|
@doc """
|
|
Determines if a word or sentence is a pangram.
|
|
A pangram is a sentence using every letter of the alphabet at least once.
|
|
|
|
Returns a boolean.
|
|
|
|
## Examples
|
|
|
|
iex> Pangram.pangram?("the quick brown fox jumps over the lazy dog")
|
|
true
|
|
|
|
"""
|
|
|
|
@spec pangram?(String.t()) :: boolean
|
|
def pangram?(sentence) do
|
|
Enum.all?(?a..?z, fn c -> c in String.to_charlist(String.downcase(sentence)) end)
|
|
end
|
|
end
|