In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2025 Day 2 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 2 of the Advent of Code - https://adventofcode.com/2025/day/2

50 REPLIES 50
aiahwieder
9 - Comet

Brute force but it worked!

 

Anybody found a good way to

 

Spoiler
use the IterationNumber constant in a Regex Tokenize expression?
clmc9601
13 - Pulsar
13 - Pulsar

Thankful for a 30-minute problem! This doesn't feel like a very elegant solution, but at least it's macro-free...

 

Spoiler
Generate Rows and regex, classic AoC. I'm really curious to see if anyone solved it completely in regex. 

I used regex_match and regex_countmatches to make sure the entire pattern is composed of the same subcomponents and that each subcomponent is listed >1 times.
2025-12-01_23-34-29.PNG
clmc9601
13 - Pulsar
13 - Pulsar

@aiahwieder, my thoughts:

 

Spoiler
While the Regex tool doesn't take values from variables easily, you can probably reverse engineer your solution to use regex_replace (add delimiter) in a Formula tool in combination with the Text to Columns tool (split to rows/columns). The regex functions in an expression editor should allow any value from variables as long as they're input as a string.
mmontgomery
11 - Bolide
11 - Bolide

Day 2

Spoiler
Part 1 was straight forward to generate rows then do a left/right logic based on length.
Part 2 I created separate logic for each sub length: 1, 2, 3, 4, 5 to match on,union then get rid of duplicates2025_Day2.jpg
aiahwieder
9 - Comet

Might try this out and report back; fortunately the data set was strings no longer than 10 characters, but it made me long for an iterative approach!

lwolfie
11 - Bolide
Spoiler
Screenshot 2025-12-02 091616.png

Had to actually work, so I missed the posting. Still fun and glad I got my 2 stars again!

DanFlint
8 - Asteroid
Spoiler
DanFlint_0-1764691360623.png

 

Ended up solving part 2 when trying to figure out the RegEx for part 1

Hub119
12 - Quasar
12 - Quasar

Day 2 Solve

Spoiler
After the input parsing and generating the numbers that needed checked (also while solving did the quick range check first to determine how many records I would be creating... no need to blow up another computer), for Part 1 I went with a simple filter to records that were an even number of characters and matched the left half to the right half.  For Part 2, while a single RegEx match function is all that is really needed, it took me a bit longer than I'd like to sort out the right RegEx to actually do so... I blame the Advent of Whiskey calendar that has been going alongside this year's event #HardMode
AoC 2025 D2 Pic.png
mkeiffer
11 - Bolide
11 - Bolide
Spoiler
Screenshot 2025-12-02 at 7.52.03 AM.png

 RegEx is my hero! 

Labels
Top Solution Authors