jpages on Nostr: Advent of Code - Day 23 Part 1 : 4h11:00 (rank 5271) Part 2 : 16h02:15 (rank 7541) I ...
Advent of Code - Day 23
Part 1 : 4h11:00 (rank 5271)
Part 2 : 16h02:15 (rank 7541)
I started late but got easily the first star with a "naive" algorithm.
For Part 2, I had to rewrite the code from scratch. I decided to build a graph from the labyrinth (where nodes are crossroads, start and end points). Then, I used a DFS algorithm.
I spent many hours trying to optimize the code, prune the paths tree and get a correct runtime (100 ms). Furthermore, my first answer was too high.
#AdventOfCode
Part 1 : 4h11:00 (rank 5271)
Part 2 : 16h02:15 (rank 7541)
I started late but got easily the first star with a "naive" algorithm.
For Part 2, I had to rewrite the code from scratch. I decided to build a graph from the labyrinth (where nodes are crossroads, start and end points). Then, I used a DFS algorithm.
I spent many hours trying to optimize the code, prune the paths tree and get a correct runtime (100 ms). Furthermore, my first answer was too high.
#AdventOfCode