Hi! It was also my first time in Advent of Code.
There is my solution for the first day in Elixir: click, GitHub
Except input setup the code looks like:
def part1() do numbers = Enum.map(@numbers, &String.to_integer(&1)) [res | _] = for x <- numbers, y <- numbers, x + y == 2020, do: x * y res end def part2() do numbers = Enum.map(@numbers, &String.to_integer(&1)) [res | _] = for x <- numbers, y <- numbers, z <- numbers, x + y + z == 2020, do: x * y * z res end
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi! It was also my first time in Advent of Code.
There is my solution for the first day in Elixir: click, GitHub
Except input setup the code looks like: