2023 Day 20: Pulse Propagation

I usually look at the general leaderboard for each problem to get an impression of how difficult the “experts” find it. It surprises me that the general leaderboard for day 20 suggests that this has been the hardest problem so far: nearly 49 minutes for the first 100 participants to complete it! The only one that came close to this relative difficulty was day 10, with 36 minutes before the first 100 participants completed it.

Day 20 didn’t seem that complicated to me. So long as you read the problem carefully, and I do mean carefully, part 1 is possibly the most straightforward problem yet. The only thing that makes part 2 challenging is that the answer is a “ludicrous size” number, so you don’t want to wait around for it. But the technique to make it work has already been used with other problems: look for the module that activates rx, then look for the modules that activate it. They broadcast the correct pulse at a regular period already from the beginning, and it’s not at all hard to work out whether those modules need to broadcast Low or High in order to activate rx’s source, so compute the lcm of those periods and you’re done.