Discussion thread for day 20 of the Advent of Code - https://adventofcode.com/2023/day/20
Finally, done. In last three days, I have been always thinking of D20 except for sleeping time(seriously).
I feel that D20 description is NOT easy to understand, and needed some assumption, to be honest. I'm writing what we need to understand to solve D20 in the below Spoiler.
For Part2, never try Brute Force, because it will just end up warming up your room temperature.
My WF
Part1
Part2
The idea of high pulses and low pulses immediately brought to mind computers and binary signals especially with Flip Flops and Conjunction modules that function like N-AND gates. @gawa has done a good job explaining the structure of the problem although, I would like to correct a couple things to hopefully not over complicate things for those who are attempting this problem. Every high/low pulse can be thought of as a singular entity that populates a queue, where each pulse will be evaluated one at a time in the order that they entered the queue. This means that the case @gawa included in his diagram for the conjunction module, where multiple signals enter the module at once will never occur, this is also true for the Flip Flop Modules. You do not need to think through or build a workflow that handles multiple synchronized inputs for any module because that will not happen. Just focus on one input at a time (it is actually the case that you will never even have two neighboring signals in the queue going to the same module):
Queue Position | Instruction |
1 | Low to %A |
2 | High to %A |
3 | High to &B |
^The example above will never occur in solving this problem (if it does, something is wrong) because Position 1 and 2 both have signals going to %A, one immediately after the other. The following example is something you could see:
Queue Position | Instruction |
1 | Low to %A |
2 | High to &B |
3 | High to %A |
Here is the structure/function of the Conjunction Module:
Hint for Part 2:
Workflow:
I have included my LCM macro.
Happy Solving!!!
I built python code first, and refer to reddit as well.
then convert to alteryx.
have to say that when change 1 or 2 lines/ variable. alteryx take much extra time to do it.
python less then 1 minute for both parts.
my alteryx workflow is take 7mins~ for part1 and 30mins~ for part2.
this time taken is hard to analysis or change...
This is needed the most complex logic in this year's AoC. I made the iterative macro and dispose it many times .I am seriously wondering why there are NOT multiple repetitive inputs and outputs in Alteryx Iterative macro.
Viz by Network analysis tool
Device status( flip flop status) :
So I unioned as follows.
On each repeat, I filtered them ans used them.
This is outer macro for pusing 1000 times.
I spent a few days before the holidays trying to do this and picked it back up today. Logic in spoiler
I don't want to see this anymore...