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

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 3 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

68 REPLIES 68
clmc9601
13 - Pulsar
13 - Pulsar

Such a relief when regex works the way I intended on the first try 😅

 

Spoiler
Tokenize for the win! I'm very surprised there weren't any parsing tricks... that would have been very on brand for AoC.

 
2024-12-02_23-13-44.PNG

kelsey_kincaid
12 - Quasar
12 - Quasar

Refreshing on RegEx ahead of Advent of Code has already paid off this year!

 

Spoiler
2024_Day3_KelseyKincaid.png2024_Day3_RegEx_KelseyKincaid.png
CoG
14 - Magnetar

I had some trouble with my code, initially, but managed to identify and resolve the bugs I ran into quickly

 

Spoiler
Main.png

 

gawa
16 - Nebula
16 - Nebula

It's about 'Parse'.

Spoiler
When complicated parse is needed, Regex tool will do it perfectly.
Part1: We need to parse out all pattern mul({inetger},{integer}), but not knowing how many exist.  In this case, we can use 'Tokenize' into rows.
Please be careful when regex expression includes meta characters, they must be escaped by backslash '\'.
image.png
Then, data can be further parsed into columns to extract 2 integer values.

Part2: We need to extract more patterns 'do()' and 'don't()' in addition to 'mul({integer},{integer})'. Regex can be modified to match any of those patterns by vertical bar like (pattern1|pattern2|....|pattern N)
Then, by using Multi Row Formula, we can identify which record is to be calculated.
image.png

(Edit)

Tool golf version: Part1=3 tools, Part2=3 tools

Spoiler
Formula tool is very powerful!
image.png
clmc9601
13 - Pulsar
13 - Pulsar

I love seeing the cryptic and quickly typed column names and annotations AoCers use when racing on the leaderboard. 😂 not maintainable, but so relatable and funny

AkimasaKajitani
17 - Castor
17 - Castor

Solved!

 

I should become closer friends with the RegEx tool.

Spoiler
 

image.png

But to simplify the regex, I used the Find Replace tool.

ScottLewis
10 - Fireball

The RegEx on this one was beyond my normal reach, but we got there. 

 

One useful trick was 

Spoiler
Replacing do() and don't() with single characters so you can use Parse on delimiter. 
PangHC
12 - Quasar

regex tools win the race today. 

Spoiler
Screenshot 2024-12-03 135445.png
geoff_zath
Alteryx
Alteryx
Spoiler
AoC_2024_day3.png

Labels