Sha256: e29f9ff5e6be3ce8ee46ba7409e1736a947fea91442dbef5e9d9571d990f91bd
Contents?: true
Size: 349 Bytes
Versions: 69
Compression:
Stored size: 349 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
69 entries across 69 versions & 1 rubygems