Sha256: 63dc4ac7b9a25a227eb8154dd7b2810e93eaae235826c3cd5567a84df5d07067

Contents?: true

Size: 338 Bytes

Versions: 327

Compression:

Stored size: 338 Bytes

Contents

defmodule Isogram do
  @doc """
  Determines if a word or sentence is an isogram
  """
  @spec isogram?(String.t) :: boolean
  def isogram?(sentence) do
    codepoints = sentence
      |> String.downcase
      |> String.replace(~r/\s|-/u, "")
      |> String.codepoints

    length(Enum.uniq(codepoints)) == length(codepoints)
  end

end

Version data entries

327 entries across 327 versions & 1 rubygems

Version Path
trackler-2.2.1.109 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.108 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.107 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.106 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.105 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.104 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.103 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.102 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.101 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.100 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.99 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.98 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.97 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.96 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.95 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.94 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.93 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.92 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.91 tracks/elixir/exercises/isogram/example.exs
trackler-2.2.1.90 tracks/elixir/exercises/isogram/example.exs