Advent of Code 2015 Day 4 Part 1
Mix.install([
{:kino_aoc, "~> 0.1"}
])
Get Inputs
{:ok, puzzle_input} =
KinoAOC.download_puzzle("2015", "4", System.fetch_env!("LB_SESSION"))
My answer
Enum.find(0..10000000, fn index ->
hash_head =
:crypto.hash(:md5, "#{puzzle_input}#{index}")
|> Base.encode16()
|> String.slice(0..4)
hash_head == "00000"
end)