Discussion thread for day 11 of the Advent of Code - https://adventofcode.com/2024/day/11
It tool a while to find an overflow with Int32 in Part2.
As the difference is only the number of blinking, I put it to the parameter in the macro.😉
Day 11. More in spoiler
Cool!
First part was really quickly, but second.... 🙄 I guess after 7 versions I have something that was working fast 😅
First Iterative macro
Second Iterative macro
Applied some quick simple logic for an iterative macro to get solution to part 1... then tried running this for part 2 and memory quickly became an issue after 30+ blinks and slowed WAY down... so I went back to the drawing board and realized the question had fooled me into thinking overall sequence mattered when really it only matters for the individual stone/number splits. Made a quick tweak to group by numbers as they will always be treated the same, and BAM whole thing runs in about a second. 11 down, 14 to go...
Got my hopes up when I saw the short question for the second star. Should have known! Tricks noted above in terms of realising you need to know the number of scenarios, not perform same task on each row, is key.
Good opportunity for me to brush up on iterative macros as I simply don't use them on a daily basis.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |