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:
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
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: