summaryrefslogtreecommitdiff
path: root/25.c
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2023-01-19 13:56:59 +0000
committerAdam Spragg <adam@spra.gg>2023-01-19 13:56:59 +0000
commit816b7d55d6d3dfb31904cb5d4813fb500984ab5b (patch)
treeafae8fddf2117f17d132e0671858169acdeee1a4 /25.c
parent8f0114df375c7b9bd750e3e0e6fbecb964639d3d (diff)
Puzzle 20: Do a linear scan for the num we're looking for
When the number of iterations was small, looking near the original position of the num was a good idea. As the number of iterations increases, the positions are fairly random, so speed of lookup is mostly a factor of how quickly we can scan the whole buffer. Speeds up part 2 of the problem from 2.2s to 0.12s.
Diffstat (limited to '25.c')
0 files changed, 0 insertions, 0 deletions