isogram
This commit is contained in:
9
elixir/isogram/lib/isogram.ex
Normal file
9
elixir/isogram/lib/isogram.ex
Normal file
@@ -0,0 +1,9 @@
|
||||
defmodule Isogram do
|
||||
@doc """
|
||||
Determines if a word or sentence is an isogram
|
||||
"""
|
||||
@isogram ~r/(\w).*\1/i
|
||||
|
||||
@spec isogram?(String.t()) :: boolean
|
||||
def isogram?(sentence), do: !Regex.match?(@isogram, String.downcase(sentence))
|
||||
end
|
||||
Reference in New Issue
Block a user