ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2025 Day 4 (BaseA Style)

AlteryxMatt
Moderator
Moderator

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

Matt Rotundo
Alteryx Community Moderator
43 REPLIES 43
lwolfie
11 - Bolide

2 Stars again!

kelly_gilbert
13 - Pulsar

This one was fun!

 

Spoiler
Outer workflow:

AoC2025-04-img-alteryx.png



Iterative macro:
Iterates until there are no more moveable rolls.

AoC2025-04-img-alteryx-macro.png

 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

My solution.

Spoiler
Main Workflow
AoC_2025_Day4_workflow.png
Macro
AoC_2025_Day4_iter.png
Desmond
9 - Comet

Blunt force to solve part two, should have built a macro but I expected it to take less iterations to get to the answer so away I went with the copy and paste method...

mkeiffer
11 - Bolide
11 - Bolide
Spoiler
Screenshot 2025-12-06 at 10.50.42 AM.png

  Scrambling to get caught up!

Spoiler
Screenshot 2025-12-06 at 10.51.18 AM.png

CoG
14 - Magnetar

For those who despise both macros and your own sanity but love Base-A AoC, then look no further because P2 can indeed be solved without a macro. The downside is that the solution is over-complicated and much slower (4x slower for me).

 

Spoiler
Screenshot_v03.png

It looks deceptively simple, and you can continue to live in that blissful ignorance as long as you do not open the Generate Rows Tool :)

Practically, speaking the solution isn't really that complex, it's just the implementation that gets you. It's a lot of RegEx covering every possible case of a paper roll being surrounded by 0-3 other rolls of paper. REGEX_Match() looks for the pattern and REGEX_Replace() removes the roll. I tried to optimize everything as much as I could think to, but it's still quite complicated.

I hope y'all are enjoying Advent of Code as much as I am. Happy Solving (again)!

 

Carolyn
12 - Quasar
12 - Quasar

Solved!

 

Since AoC involves a lot of walking to adjacent squares, I went ahead and built a macro to find all the adjacent spots, with the ability to include/exclude the diagonal squares.

 

From there, nothing too crazy. Within the iterative macro, I added a Count to compare the initial records with the final records in an iteration so that way it's really easy to identify when nothing is removed.

 

Spoiler
2025-12-06 18_52_44-Alteryx Designer x64 - 2025 04 AoC Carolyn.yxmd.png

2025-12-06 18_56_45-Alteryx Designer x64 - D4.yxmc.png
JoshuaB
Alteryx
Alteryx

This is part 1, I'm working on a non-macro path for part 2

 

Spoiler
JoshuaB_0-1765137356722.png

 

Joshua Burkhow | Chief Evangelist @ Alteryx | Follow me on LinkedIn and Twitter
martinson
11 - Bolide

Part 1

Spoiler
martinson_0-1765199717752.pngmartinson_1-1765199730064.png

 

Part 2

Spoiler
martinson_2-1765199752267.pngmartinson_3-1765199766549.png

 

 

Cheers,
martinson

LinkedIN

Bulien
estherb47
15 - Aurora
15 - Aurora

Enjoyed this one!

 

Spoiler
In years past, I've done these types of challenges as spatial. So in the vein of trying something new, decided to go a different route.

Used the multi-row tool to find up to 8 neighbors for each location, identified what should be removed, rebuilt the rows.

estherb47_0-1765237503426.png


The sort is key to the multi-row tool.

estherb47_1-1765237562874.png

 

Labels
Top Solution Authors