Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 3 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2023/day/3

53 REPLIES 53
gawa
16 - Nebula
16 - Nebula

I had to use Appendix Field...I mean brute force attack! (Appreciate AMP engine)

Spoiler
image.png
phottovy
13 - Pulsar
13 - Pulsar

Joins to the left of me, joins to the right, here I am stuck in the middle with you:

 

Spoiler
03.png
kelsey_kincaid
12 - Quasar
12 - Quasar

Definitely spun my wheels, spent too much time overthinking, and reworked things too many times, but got there!

 

Spoiler

Part 1: Spent a fair amount of time figuring out the best way to split out the values in each row to keep adjacent digits together as a single value, but also determine each number's position in the row. To account for that I created way too many IDs - one for the Row, one for the value, one for the column... I'm embarrassed to say those aren't the only ones. I've learned that when I'm not sure what I'm doing I find comfort in creating IDs for some reason 😂. Separated numbers from symbols and did a brute force append to find all possible combinations of numbers & symbols to determine if they were adjacent.

 

Part 2: Luckily, I was able to use most of my Part 1 solution to figure out Part 2. Just had to isolate possible gears and then determine how many numbers were adjacent to each possible gear.

 

AOCDay3.png

AkimasaKajitani
17 - Castor
17 - Castor

My solution. The Map style question is too early on Day3.

.

Spoiler
I made the neighbor list which has not numeric string and then I joined the numeric list and neighbor list. The neighbor list also worked well at part 2, so it contribute to solving the part 2 efficiently.

スクリーンショット 2023-12-03 145349.png

NicoleJ
Alteryx
Alteryx

Oooof. Same, @phottovy . Same. 
Full transparency - I did temporarily output data to Excel so I could conditionally format the data (parts were green, potential gears were red) just so I could wrap my head around what I was looking at... which might have actually led me to my "I wonder if this matters" aha! moment in the spoiler. So... thanks Excel?

Spoiler
I struggled with Part 2 until I was able to visualize the puzzle, and noticed that there were gears with parts on either side (rather than just above & below, as in the example), and I started wondering if that mattered/was impacting something with the wrong answers I was getting... and then I realized I was using a count distinct on the part row field instead of a count to identify cases where there were 2 parts to a gear... and I really can't put into logical words how I got there... but I figured out there was a problem and then I started annotating my steps until I could rationally explain what was happening in each one and then I visualized it and spotted something that got my spidey senses tingling and then I smacked my head because Count Distinct and Count are very much not the same thing. 

BUT!! I got to use that new Summarize Product function for the 2nd day in a row!!! So all is well, and now I can go to bed. 😁
 
Day3_NJ.png

My sweet Excel visualization: 
 
Day3Excel.png

 

Cheers!
NJ
Sr. Manager, Product Management, Designer
Alteryx
DaisukeTsuchiya
14 - Magnetar

It was tough as Day3.

Spoiler
スクリーンショット 2023-12-03 152616.png



joshbennett
11 - Bolide
11 - Bolide
Spoiler
For Part 1, I identified the xy coordinates of each character. Then, I broke out numeric characters and grouped them into identifiers for each non-breaking numeric sequence within a given record and joined them back to the individual numeric characters, giving me the xy coordinates of each digit in each non-breaking numeric sequence. I then broke out the symbol characters and identified horizontal, vertical, and diagonal neighbor xy coordinates for each symbol, at which point I joined this to the xy coordinates of the non-breaking numeric sequences to identify every "part number" (i.e., numeric sequence having 1+ symbol neighbors), and then summed the part numbers to get the answer.

For Part 2, I used Summarize on the join results from Part 1 to identify asterisk symbols with exactly 2 neighboring part numbers and then multiplied each symbol's part numbers and summed the products across all records.

Screenshot 2023-12-02 232552.png

I wish there was a more intuitive way to handle grid operations in Alteryx, but it is more fun than it should be to figure out. Looking forward to seeing others' solution strategies.

clmc9601
13 - Pulsar
13 - Pulsar

This was a chewy challenge for Day 3. I enjoyed it without getting too frustrated!

 

Spoiler
 
 
 

@AkimasaKajitani your generate rows for finding adjacent coordinates is so elegant! 

Tokimatsu
12 - Quasar

 We're still good.

 

Spoiler
スクリーンショット 2023-12-03 154324.png
Labels
Top Solution Authors