Sha256: 8a33310411539efb1852967170626fd698e4a9ab58d88a3a9a9e4580d3e97231

Contents?: true

Size: 530 Bytes

Versions: 66

Compression:

Stored size: 530 Bytes

Contents

defmodule Alphametics do
  @type puzzle :: binary
  @type solution :: %{required(?A..?Z) => 0..9}

  @doc """
  Takes an alphametics puzzle and returns a solution where every letter
  replaced by its number will make a valid equation. Returns `nil` when
  there is no valid solution to the given puzzle.

  ## Examples

      iex> Alphametics.solve("I + BB == ILL")
      %{?I => 1, ?B => 9, ?L => 0}

      iex> Alphametics.solve("A == B")
      nil
  """
  @spec solve(puzzle) :: solution | nil
  def solve(puzzle) do
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.179 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.178 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.177 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.176 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.175 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.174 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.173 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.172 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.171 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.170 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.169 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.167 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.166 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.165 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.164 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.163 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.162 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.161 tracks/elixir/exercises/alphametics/alphametics.exs
trackler-2.2.1.160 tracks/elixir/exercises/alphametics/alphametics.exs