Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 11 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 11 of the Advent of Code - https://adventofcode.com/2024/day/11

27 REPLIES 27
PangHC
12 - Quasar

today challenge remind me about 2021 day 6 challenge. It look alike. 

Spoiler
part1: easier to do it in string format. substring is quite annoying to use, i use regex_replace instead. 
  regex_replace([data],"\(d{"+tostring([length]/2)+"})(\d+)","$1|$2")

part2:
tips: group by
CoG
14 - Magnetar

Absolutely loved this problem. Part 2 took me a few minutes to realize the trick that changes the problem from being unsolvable to being a walk in the park (Glad I got to use some interface tools this time!):

 

Spoiler
The trick is to realize that the order of the rocks is irrelevant. This means that you don't need to track each rock. Instead, you can group all rocks with the same number after each blink and track how those two numbers change overtime (which decreases the number of records you need to maintain in memory by many orders of magnitude). I felt a sense of exhilaration and pure delight when that insight clicked in my head. I reconfigured my macro with that insight, and was done very shortly after that!

Main Workflow:
Main.png

Blink (Iterative Macro):
Blink.png

 

gawa
16 - Nebula
16 - Nebula

Need some trick on part2 to finish calculation. 

Spoiler
Part1: Nothing special, just follow instruction.
Part2: If there are 2 or more stones having the same number, they shall be grouped into one and sum up their count, and remember that count. As the stones having the same number will transform in the same way at next blink, no need to evaluate them separately. Repeat 'grouping and summing up count' process until 75 times of blink.
image.png 
AkimasaKajitani
17 - Castor
17 - Castor

Solved!

 

Today is straightforward, too.

 

Spoiler
image.png
Part 1 macro

image.png

Part 2 macro
image.png

Part 2 was needed a little minor change.

Qiu
21 - Polaris
21 - Polaris

Got hint from here. 😁

Spoiler
AOC2024-Day11.png
peter_gb
10 - Fireball

Took me longer than I wish to admit to figure out the trick to part two, and also just let it run in the blind hope it would be fine, knowing that it wouldn't be...

Got there in the end!

 

Spoiler
AoC_11.png


AoC_11_1.png


AoC_11_2.png
mark-spain
8 - Asteroid

Spent 10 minutes iterating with the same macro for Part 2, with my computer sounding like it was going to take off before I worked it out! Ran in 1.5 seconds for part 1 and 2. 

Spoilers ahead:

Spoiler
AoC 2024 Day 11.png

 


Part 1 simple iterative macro increasing record count over 25 iterations:
AoC 2024 Day 11 - Macro Part 1.png

 

Part 2, added Grouping logic and kept a record of how many times a number exists in the data. This massively reduced processing time as the number of records do not balloon as they do with the first macro. 

AoC 2024 Day 11 - Macro Part 2.png

 





ntakeda
12 - Quasar

My workflow is not good...

 

Spoiler
My Workflow is complicated and not beautiful.
There are many occurrences of numbers 0-9. for 0-9, the results were combined after 5 blinks.
Results other than 0-9 were blinked 5 times.
This was repeated 15 times (5*15).

So my workflow has macro nesting.

 
2024-12-11_17h09_39.png2024-12-11_17h10_01.png2024-12-11_17h10_15.png

   

 

 

 

DataNath
17 - Castor
17 - Castor

Day 11 & another 2 stars down! Despite my defiance in the WhatsApp group, I did indeed end up optimising this in order to save my laptop.

 

Spoiler
Day 11 - Workflow.png

Day 11 - Iterator.png 
Labels
Top Solution Authors