:: krowemoh

Thursday | 26 DEC 2024
Posts Links Other About Now

previous
next

Advent of Code 2023 - Day 14

2023-12-14
advent-of-code

I skipped day 12 and day 13 as they looked pretty hard. I didn't spend too much time on them as it's been a busy few days but I doubt I would have completed them anyway.

Day 14 was difficult but doable, the first part especially was straightforward but part 2 took some time. I got the logic right very quickly but proving it took some time as trying to keep a list of maps to detect the cycle was taking a really long time.

The locate statement in BASIC ended up being the bottleneck and I tried writing to a file or storing the maps in a hashmap but both didn't speed things up that much. I then checked reddit to see how long a cycle usually was so I knew how long it would take to detect something and found that it was about 150 iterations. Within 150 iterations the cycle will start and then you can math out what the billionth iteration is going to be.

I'm pretty happy that I solved it myself but boy is this stuff getting painful.

Day 14