AdventOfCode/day1
2020-12-01 14:36:44 +09:00
..
day1part1.exs Day 1 Part 1 2020-12-01 14:19:13 +09:00
day1part2.exs Day 1 Part 2 2020-12-01 14:36:44 +09:00
input Day 1 Part 1 2020-12-01 14:19:13 +09:00
README Day 1 Part 2 2020-12-01 14:36:44 +09:00

Day 1 Notes

------
Part1:
------

$ elixir day1part1.exs
618 x 1402 = 866436

Thoughts:

Avoid iterating seen elements by consuming the list, and comparing each list element only to the remaining
elements.

------
Part2:
------

$ elixir day1part2.exs
547 x 545 x 928 = 276650720

Thoughts:

Use a comprehension over two versions of the remaining list to efficiently compare the three items.