Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 12 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

19 REPLIES 19
ntakeda
12 - Quasar

My solution.

Spoiler
Mark records for which record have already found a group.
When all record have been marked, finish.
It takes 4 minutes because it is not running in parallel...
2024-12-13_13h51_32.png

2024-12-13_13h51_43.png

DataNath
17 - Castor
17 - Castor

Finally finished up with #12! Spent an insane amount of time going down rabbit holes that would all work for all but one of the sample grids, before taking a few hints from here & getting over the line!

 

Spoiler
Day 12 - Workflow.png
mmontgomery
11 - Bolide
11 - Bolide

Day12. More in spoiler

Spoiler
P1: Make group was the key piece to tie elements together then I created a new field called new_data to organize it then find boundaries
P2: I struggled for a long time and had a similar approach to @ntakeda and his final part inspired mine to finish itDay12.png
DaisukeTsuchiya
14 - Magnetar

I tried solving Day 12 P1 and P2 again using the Spatial Tool although I solved it without spartial tool.
Last time, I struggled a lot, drawing diagrams in Excel and pondering over them, but this time, I was able to solve it very easily.
As expected, the Spatial Tool at bottom container is much better because it's more visually intuitive.

Spoiler
スクリーンショット 2024-12-14 063411.png




geoff_zath
Alteryx
Alteryx
Spoiler
AoC_2024_day12.png

Tokimatsu
12 - Quasar

Solved without macro.

Spoiler
スクリーンショット 2024-12-16 095645.png

Samantha_Jayne
Alteryx
Alteryx

And she is finally back in the game. Thanks to Cory on the WhatsApp for helping me find what I was missing. Turns out my dataset also had a few red herrings in there too. But I finally found all those. Phew. Spoiler below. #darkmoding

 

Spoiler
Day 12 - Both Stars.png
Samantha Clifton
Alteryx
#alteryxrocks
kelsey_kincaid
12 - Quasar
12 - Quasar

This one took me awhile to wrap my head around. Part 1 was one thing, Part 2 was another. After looking at some other solutions, @Yoshiro_Fujimori 's really resonated. Thanks for your insights!

 

Spoiler
Part 1: Took some time to find the right approach, but the key is just to determine how many adjacent cells do not have matching data.
Part 2: I started by trying to determine which cells were corners, but without leveraging spatial tools. It's doable, but I was having a hard time visualizing and wrapping my head around the logic. Converting to spatial to get a visual of the corners and remove some of the noise from irrelevant cells was a game changer. I also learned a new formula - ST_Boundary - which I had never used before. That's what I love about Advent of Code - I ALWAYS learn something new!

D12.png
estherb47
15 - Aurora
15 - Aurora

Took the spatial route. Didn't do anything different than others here.

 

Spoiler
One thing I love about a spatial approach is being able to divide up the different shapes that have a common letter, using the Poly-Split tool. It's an easier way for my brain than make groups (which also works really well)

Also, fun finding by just messing around with the spatial tools. In part 1, if you use bounding boxes, the number of parts added up for each shape gives you the perimeter.

For part 2, calculated the point to point movement around the bounding boxes (a few poly splits take care of only catching the perimeter boxes of the shapes), and with a change in direction, increase the number of sides of the polygon. Unsure how a few of these wound up with odd numbers, which was throwing the total off, so if the number of sides were odd, subtracted one.

image.png
Carolyn
12 - Quasar
12 - Quasar

A HUGE thank you to @DaisukeTsuchiya . I was trying to solve Part 1 the way that you did but instead of using the Make Groups, I just made a huge mess of it multiple times. I was actually pretty close with my first attempt, which was a macro to make the groups (only off by 2k for the final answer). When I used yours as a guide for doing a proper Make Groups and then seeing how to Join everything back together, I was able to solve it. 

 

Part 2 was actually relatively easy, compared to Part 1. Excel helped me visualize it and then it was just a case of making sure my Sorts were in the right order

 

Please no one judge me for anything in the disabled containers. I'm so glad this one is done!

 

Spoiler
Part 1: 
2024-12-27_12-22-18.png

Part 2: 
2024-12-27_12-21-49.png

 

2024-12-27_12-23-39.png

 

Labels
Top Solution Authors