Advent of Code 2015 Day 10 Part 2
Mix.install([
{:kino_aoc, "~> 0.1"}
])
Get Inputs
{:ok, puzzle_input} =
KinoAOC.download_puzzle("2015", "10", System.fetch_env!("LB_SESSION"))
My answer
get_char_group_list = fn input ->
Regex.scan(~r/(.)\1*/, input)
|> Enum.map(fn [max, min] ->
"#{String.length(max)}#{min}"
end)
|> Enum.join()
end
1..50
|> Enum.reduce(puzzle_input, fn _, acc_input ->
get_char_group_list.(acc_input)
end)
|> String.length()