You are reading a single comment by @wence and its replies.
Click here to read the full conversation.
-
Got my python version to about the same speed with some judicious caching https://gist.github.com/wence-/500e1bc4633192ac6fee67433aedd974#file-day12-py.
For the C there's a bit to be gained by using a single
uint32_tfor the visited array, but there's much more on the table with some caching: probably sub 200us.
Fast Day 12 code in C:
https://gist.github.com/alexgreenbank/32a8d0c005dd61b5ca9c781921ff5cec
(I'm sure there's another 10% or so to be had but can't be bothered now.)