Part 1 was mostly a matter of getting the pseudo random generator right.
For Part 2 I tracked every 4 number sequence and the corresponding value, the first time that sequence was seen for the buyer, and see which sequence had the highest combined value. A bunch of the intermediate values could be optimized away, but helped to keep my head straight and since it only took a few seconds to run... 🤷🏻♂️
https://github.com/jochie/adventofcode/tree/main/2024/22
[#]AdventOfCode #Python #Programming
=> More informations about this toot | View the thread | More toots from jochie@strangeweb.page
=> View adventofcode tag | View python tag | View programming tag This content has been proxied by September (3851b).Proxy Information
text/gemini