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
Published at
2023-12-23 22:55:59Event JSON
{
"id": "7a6aaa82f6e36ea96bc08cae12425d0b6ba486f192232d94ef9cf2bb44a6806f",
"pubkey": "d8deeeee9fcf88be9fdb85da854869fa1855bd20d23f54599dcc9d4adb42f1d0",
"created_at": 1703372159,
"kind": 1,
"tags": [
[
"t",
"adventofcode"
]
],
"content": "Advent of Code - Day 23\n\nPart 1 : 4h11:00 (rank 5271)\nPart 2 : 16h02:15 (rank 7541)\n\nI started late but got easily the first star with a \"naive\" algorithm.\n\nFor 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.\n\nI 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.\n\n#AdventOfCode",
"sig": "ef1e70818e104c7862156760d0fed1a809ecb3fcc4b0bc2d887f49a9c7e2acb2cdd1402b5d0114261a1d330f4ce8d8570a5c5916095d0bce752dc9e27440f6a7"
}