Day 2, Part 1 and Day 2, Part 2 of #AdvenOfCode all done and dusted π
My code is here. https://git.sour.is/xuu/advent-of-code-2023
@xuu@txt.sour.is Ah, you went with the βscanningβ approach as well. I did that, too.
Itβs quite surprising to see (imho) how many people on reddit started substituting strings (one
becomes 1
etc.). That makes the puzzle much harder by introducing nasty corner cases.
(Maybe I was just lucky this time to pick the correct approach right from the start. π€£ Or maybe itβs a bit of experience from doing past AoC events β¦)
I could have made my search smarter using a prefix search rather than scanning the full buffer for each iteration.