Skip to content

Commit

Permalink
Fix format for isogram in Elixir
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgoettschkes committed Nov 5, 2023
1 parent f30aa1b commit 3633b35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions elixir/isogram/lib/isogram.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ defmodule Isogram do
"""
@spec isogram?(String.t()) :: boolean
def isogram?(sentence) do
clean = sentence
|> String.downcase()
|> String.codepoints()
|> Enum.reject(fn char -> char == "-" || char == " " end)
clean =
sentence
|> String.downcase()
|> String.codepoints()
|> Enum.reject(fn char -> char == "-" || char == " " end)

length(clean) == length(Enum.uniq(clean))
end
Expand Down

0 comments on commit 3633b35

Please sign in to comment.