Sha256: cad9fe4c1dc99a54792f0cc00fa7cdad843d26259247ff75da827dd31d4071f5

Contents?: true

Size: 479 Bytes

Versions: 265

Compression:

Stored size: 479 Bytes

Contents

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
    chars =
      sentence
      |> String.downcase
      |> to_char_list

    Enum.all? ?a..?z, &(&1 in chars)
  end
end

Version data entries

265 entries across 265 versions & 1 rubygems

Version Path
trackler-2.2.1.47 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.46 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.45 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.44 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.43 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.42 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.41 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.40 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.39 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.38 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.37 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.36 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.35 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.34 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.33 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.32 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.31 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.30 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.29 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.28 tracks/elixir/exercises/pangram/example.exs