Advent of Code 2023 - Day 3

I did something I didn’t see in other solutions. I created an index of positions for all the numbers, but also added a unique id to each number. That way, the number 467 can be indexed as [{{0,0}, {id_1, 467}}, {{0,1}, {id_1, 467}}, {{0,2}, {id_1, 467}}]
That way, adjacency is trivial, and then deduplicating numbers is also trivial (as the same number might be adjacent to a symbol multiple times)

Solution: advent_of_code/2023/day_03.ex at master · juanperi/advent_of_code · GitHub