defmodule Triple do
def triple_trouble(one, two, three) do
first = String.graphemes one
second = String.graphemes two
third = String.graphemes three
List.foldl(first, [], fn char1, acc1 ->
List.foldl(second, [], fn char2, _acc2 ->
List.foldl(third, [], fn char3, _acc3 ->
[char1 <> char2 <> char3] ++ acc1
end)
end)
end)
end
end
I think I'm getting closer.
Input "what", "what", "what"
Incorrect output ["ttt", "att", "htt", "wtt"]