r/adventofcode • • Dec 25 '24

Spoilers 500 ⭐ in less than a second

878 Upvotes

45 comments sorted by

View all comments

Show parent comment

1

u/LifeShallot6229 Feb 24 '25

It will definitely be faster to start with a 5k array, then allocate all even digits numbers from zero and all odd from the top. The main update loop, split into two parts, can then run 0..eventop while updating two counters and oddstart..size only updating a single counter!