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 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
24 REPLIES 24
Hub119
12 - Quasar
12 - Quasar

Got my hopes up when I saw the input to this problem, thinking it would be some sort of maze solve... alas, it was much simpler than that.  Can't believe we are already 1/3 of the way through AoC 😭.

Spoiler
AoC 2025 D4 Pic.png
Spoiler
The macro was almost an exact copy of what I did for part 1....
MacroMacro
Tokimatsu
12 - Quasar

Very simple.

Spoiler
I used X and Y coordinates, but it wasn't necessary to divide it into individual cells.
I'm gathering the surrounding cells using string-related functions.
スクリーンショット 2025-12-04 150211.png

スクリーンショット 2025-12-04 150238.png

gawa
16 - Nebula
16 - Nebula

Every time when I see map style puzzle in AoC, I'm always overwhelmed at first according to past experience(unlike @Hub119 😁)

However, today's puzzle was very straightforward without having to come up with something clever.

Ah, 1/3 is already over this year...

 

Spoiler

 

image.png

Part1

The context of puzzle was simple, and everything was smooth but my answer was wrong at the end. Thing is that, I didn't realize the presence of rolls that have no

neighborhood in any of 8 surrounding position. Count of those presence were missing, that takes extra time to reach to the goal.

Part2

Nothing special. The solution for part1 is applicable to part2. Just iterating process where I felt it's too straightforward....

In my twisted assumption, usual part2 would ask...

"when roll paper is removed, new roll papers will be generated at surrounding 8 position." or input data is so designed that only one roll paper is removed in one iteration that require huge iterations.

 

Anyway, just for fun, I created visual map how rolls have been removed. 

Yellow: Remained rolls after all iteration

Blue: Removed during iteration (concentration depends on iteration number in which roll was removed)

image.png

 

Stosh
6 - Meteoroid

Another day, another AoC BaseA challenge! Today's puzzle was certainly not the most challenging one I have faced thus far, however it does feel good to be able to finish with a good time and with no assistance whatsoever (no blogs, solution peeking, or asking neighbors at work😂). That being said, I now have nearly the full 24 hours to wait until the next one😢

My solutions:

Spoiler
Part 1 and 2 of my solutions
Stosh_0-1764829040891.png

The macro used in Part 2

Stosh_1-1764829118901.png

 

My reflection:

Spoiler
As mentioned above, this problem was not very challenging for me, as evidenced by the fact that it took me <1 hour whereas the first 3 each took multiple hours and some hint searching. It could be argued that my solutions are big and ugly, and I might have to agree with you based on looks alone, but the strategy is not very complex. 

For part 1, I use multi-row tools to look up, down, left, and right and store that for each square in the grid. For corners, I created join keys in a duplicate table and join based on row +/- 1, column +/- 1, with the unions used to catch edge and corner squares on the grid that won't have certain diagonal neighbors. From there, I simply count the number of '@'s and return the candidates who had less than 4.

For part 2, I literally copied the second half of my part 2 solution into a separate canvas and converted it into an iterative macro that runs until there are no more removable candidates on the grid. The only addition includes an additional join between the removable candidates and initial input to convert the '@'s to '.'s for the subsequent iteration. 

All in all, I am excited to see how much more efficient some of the more seasoned participant's solutions are, but I am super proud of my speed today, and I think I would have an easy time explaining this to someone else, which is a benchmark I always set for myself when building flows for clients.

 

Raj
16 - Nebula

Almost repeating the first part's logic and iterating it for second part
Overall, a good challenge.

CoG
14 - Magnetar

Another simple problem! Made a macro this time. Macro-less is potentially possible, but I do not want to deal with that headache.

 

Spoiler
Screenshot.png
For the main workflow, we begin by tokenizing the input so that every row has a single value, then we use the Generate Rows Tool to get a 1 row & column buffer around each cell, and count the paper roll neighbors.

Screenshot - Macro.png
For the macro (for part 2), we start with the exact same procedure, but this time, we prune/remove those rolls that satisfy the sparse-neighbors criteria and check to see if we removed any rolls. If not, then we stop iterating. The bottom Macro Output Tool is our primary output, and tracks how many rolls there are currently. As I write this, I just realized that I could have put a count records after the "Prune Rolls" Formula Tool (or Join Tool) to count only removed rolls.

Happy Solving, y'all!

 

Edit: I made the edit that I referred to above to optimize the macro portion of my solution. Looks much cleaner now:

 

Spoiler
Screenshot - Macro_v02.png

 

 

 

JeffF
Alteryx
Alteryx
Spoiler
The macro has the same logic as Part One.

Day04_JeffF.pngDay04_JeffF_Macro.png
danboll_life
9 - Comet

I solved it using the Spatial tools.

Spoiler
danboll_life_0-1764833332054.png

 

AkimasaKajitani
17 - Castor
17 - Castor

My solution!

 

I almost lost my way. Except for it, it is not difficult. And I use some macros which I created last year for mapping problem. It works well.

Spoiler
AkimasaKajitani_1-1764834136984.png

 



Macro:
AkimasaKajitani_0-1764834110897.png

 

 

Labels
Top Solution Authors