What is Nostr?
jpages /
npub1mr0…k4s2
2023-12-23 22:55:59

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
Author Public Key
npub1mr0wam5le7yta87mshdg2jrflgv9t0fq6gl4gkvaejw54k6z78gq9ek4s2