# paulfioravanti's solution

## to Isogram in the Elixir Track

Published at Jul 30 2019 · 0 comments
Instructions
Test suite
Solution

Determine if a word or phrase is an isogram.

An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.

Examples of isograms:

• lumberjacks
• background
• downstream
• six-year-old

The word isograms, however, is not an isogram, because the s repeats.

## Running tests

Execute the tests with:

``````\$ mix test
``````

### Pending tests

In the test suites, all but the first test have been skipped.

Once you get a test passing, you can unskip the next one by commenting out the relevant `@tag :pending` with a `#` symbol.

For example:

``````# @tag :pending
test "shouting" do
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
end
``````

Or, you can enable all the tests by commenting out the `ExUnit.configure` line in the test suite.

``````# ExUnit.configure exclude: :pending, trace: true
``````

If you're stuck on something, it may help to look at some of the available resources out there where answers might be found.

## Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you can see how others have completed the exercise.

### isogram_test.exs

``````defmodule IsogramTest do
use ExUnit.Case

test "isogram lowercase" do
assert Isogram.isogram?("subdermatoglyphic")
end

@tag :pending
test "not isogram lowercase " do
refute Isogram.isogram?("eleven")
end

@tag :pending
test "isogram uppercase" do
assert Isogram.isogram?("DEMONSTRABLY")
end

@tag :pending
test "not isogram uppercase" do
refute Isogram.isogram?("ALPHABET")
end

@tag :pending
test "isogram with dash" do
assert Isogram.isogram?("hjelmqvist-gryb-zock-pfund-wax")
end

@tag :pending
test "not isogram with dash" do
refute Isogram.isogram?("twenty-five")
end

@tag :pending
test "phrase is isogram" do
assert Isogram.isogram?("emily jung schwartzkopf")
end

@tag :pending
test "phrase is not isogram" do
refute Isogram.isogram?("the quick brown fox")
end
end``````

### test_helper.exs

``````ExUnit.start()
ExUnit.configure(exclude: :pending, trace: true)``````
``````defmodule Isogram do
@word_characters ?A..?z

@doc """
Determines if a word or sentence is an isogram
"""
@spec isogram?(String.t()) :: boolean
def isogram?(sentence) do
letters =
for <<letter <- sentence>>,
letter in @word_characters,
do: letter

Enum.uniq(letters) == letters
end
end``````