Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 14 (Base A Style)

MeganBowers
Alteryx Community Team
Alteryx Community Team

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

22 REPLIES 22
cgoodman3
14 - Magnetar
14 - Magnetar
Spoiler
Part 1 I was able to approach it using mod() to deal with the wrapping and not need to generate every step to 100.
I used Excel to check that this was the right logic:
Screenshot 2024-12-14 123244.png
As @CoG mentions mod() in Alteryx can provide negative numbers, whereas Excel doesn't.  To deal with negatives I used an if statement
if [newgrid_px] < 0 THEN 
[User.maxx] + [newgrid_px]
Else [newgrid_px]
ENDIf​
Part 2 is similar to day 10 in 2018, where there is a point where the stars align, or in today's case the robots.
After running a few 1,000 iterations I could see there were certain rows and columns which had a lot of robots in a line, so filtered to these. Then it was a case of increasing the iterations to cover the periodicy of the problem, which created a very clear outcome where the number of robots in line (I essentially was finding the frame around the Christmas tree) was the maximum.
Screenshot 2024-12-14 123633.png 
Which gave me a nice solve without needing to hunt through 1,000s of images - so my workflow at the end creates a nice Christmas tree.
Screenshot 2024-12-14 123057.png

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
DataNath
17 - Castor
17 - Castor

Day 14 in the bag! Used @ScottLewis' tip for part 2 - looking for a line of 6 points returned a single output which was my Christmas tree! Not very neat so maybe my flow is off slightly but we picked up 2 stars!

 

Spoiler
Day 14 - Workflow.png
Hub119
11 - Bolide
11 - Bolide

Part 1 was pretty straightforward... Part 2 wasn't too bad once I figured out which logic to apply to it... and determined that it wasn't going to be ALL the robots that would align so shifted which metric I was tracking. 14 down, 11 to go!

Spoiler
WorkflowWorkflow
Spoiler
Tree ImageTree Image

 

mmontgomery
11 - Bolide
11 - Bolide

Day14. More in spoiler

Spoiler
P1: Did a simple macro to account for each position since was 100 iterations
P2: Brute force 10k combos and write down two distinct patterns appearing horizontally and vertically, then figure out the delta between them and create possible combos with generate rows to narrow the search. I saw it visually in the report map
Day14_Workflow.pngDay14_Macro.pngResult.png
DaisukeTsuchiya
14 - Magnetar

I update WF for P2 without checking thousands loops.

Spoiler
The task involved reassembling scattered robots, so I calculated the standard deviation of the XY coordinates for each loop and examined the smallest one. As expected, the case with the smallest standard deviation turned out to be the solution.

Spoiler
スクリーンショット 2024-12-15 103655.pngスクリーンショット 2024-12-15 104508.pngスクリーンショット 2024-12-15 103837.png






Tokimatsu
12 - Quasar

At first I could not imagine the goal picture.

Spoiler
I tried to check for line symmetry placement, but failed. Next, they looked at 300 pictures in each sequence. Then we found a repeating pattern.Then found P2 answer. After that create the workflow to find the goal.スクリーンショット 2024-12-16 095114.png

Carolyn
12 - Quasar
12 - Quasar

Solved. I'm not sure how I feel about Part 2. I wouldn't have gotten there without the help from everyone. I definitely would've preferred more guidance on what "make a Xmas tree" actually looked like, since I assumed it was set in the middle of the graph

 

Spoiler
For Part 2, I did a Generate Rows for 101 * 103 Rows. Then I did a Group By Iteration and End_X and Group By Iteration and End_Y. I filtered each for where the Count was > 15 (it seemed like a good number), joined them together, and found the first iteration on both. 

2024-12-15_18-04-25.png

2024-12-15_18-03-20.png
kelsey_kincaid
12 - Quasar
12 - Quasar

This was challenging but fun! 

 

Spoiler
I spun my wheels for way too long on Part 1. I fixed the issue by simply adding 1 to all of my starting coordinates. Having zeroes was making the math confusing, and I wish I'd just adjusted the coordinates sooner. I managed the "teleports" by finding a multiplier that adjusted the coordinates.
 

2024_Day14_KelseyKincaid_WF.png
Formula Examples:
FormulasD14.png

For Part 2, I iterated 10,000 times and then found the iteration with the smallest standard deviation between points. I got a lot of inspiration for this solution and visualization from some previous year solutions from @phottovy and @cgoodman3 that they highlighted recently. Without that, I would have spun my wheels trying to figure this one out. Just goes to show how much of a learning opportunity Advent of Code is!

There's probably a way to get the macro to exit early instead of hardcoding the iterations, but this only ran in 25.6 seconds so I'm OK with it the way it is :) 
2024_Day14_KelseyKincaid_Macro.png
D14Viz.png

Qiu
21 - Polaris
21 - Polaris

@Tokimatsu 
Very brilliant idea.
I did same approach but went to calculate the area of Christmas Tree.

Spoiler
AOC2024-Day14.png
Shifty
12 - Quasar

Just part 1 for me.  Part 2 seems mad.

Spoiler
Image upload failed. Try uploading a different image or from some other source.
Image upload failed. Try uploading a different image or from some other source.
Image upload failed. Try uploading a different image or from some other source.
Labels
Top Solution Authors