Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 15 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

11 REPLIES 11
Carolyn
12 - Quasar
12 - Quasar

Solved!

 

I was able to get a working solution for Part 1, but it took ~3 hours to run. While it was running, I looked through the posts here and saw @gawa's RegEx witchcraft and redid my Part 1 macro with his technique. I initially tried to just do one Generate Rows regardless of the direction, which worked, but then in the next step, I ended up with double the tools, compared to Gawa. I did the 2nd Generate Rows which then made everything else downstream much simpler. 

 

For Part 2, I initially tried to do it by naming the boxes 1 and 2 instead of [ and ], to try to still be able to use some of Gawa's fancy RegEx - it worked for the small example but not for the larger example. I also tried to just have a value for the left side of the box and blank for the right side, but that turned into a mess. Eventually, I went back to a version of what I did for my 3 hour part 1, with a lot of support from Gawa's part 2 when I kept getting stuck (THANK YOU!) and finally got something that works. It takes 3.5 hours to run, but, hey, I'm calling it a victory :) 

 

I also misread part 2 and thought it was saying the GPS was from where ever the nearest corner of the building was, vs the newest corner of the box but always from the top left. So I initially added in more logic than needed and was very confused

 

Spoiler
Part 1: Works but takes 3 hours
2024-12-27_15-03-26.png

Part 1: Gawa's RegEx method.... so much cleaner and faster. Took ~10 minutes
2024-12-27_15-02-52.png
Part 2 - took 3.5 hours, but it works
2024-12-31_15-19-01.png

 

estherb47
15 - Aurora
15 - Aurora

Part 1 completed. This was a very different challenge than I've done before (and this is my most successful year to date as far as feeling good with my solutions. 

 

Haven't tackled part 2 yet.

Spoiler
Iterative macro for the win. Brought in the row with the @ symbol, and then all cells in the up, right, left, or down position, based on direction.

Summarized them up, and then used RegEx_Replace to shift the positions if needed.

What was weird was that my usual approach of sending a long string through the iteration, rather than many short strings, took a significantly long period of time. Minutes for each individual iteration. Refactored to a long list, one cell per line, which went rapidly.

Kept joined fields to a minimum by using generate rows for the neighboring cells. 

Also, AMP on made for a much slower process. 20 minutes with AMP, 4 minutes without. 

image.png

 

Labels
Top Solution Authors