Mix.install([:kino])
input = Kino.Input.textarea("Please enter your data here")
number_of_distinct_letters = 14
input
|> Kino.Input.read()
|> String.to_charlist()
|> Enum.reduce_while({1, []}, fn
char, {count, marker} ->
marker = [char | marker]
cond do
length(Enum.uniq(marker)) == number_of_distinct_letters ->
{:halt, count}
length(marker) < number_of_distinct_letters ->
{:cont, {count + 1, marker}}
true ->
{:cont, {count + 1, Enum.drop(marker, -1)}}
end
end)