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 4 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

48 REPLIES 48
clmc9601
13 - Pulsar
13 - Pulsar

There has to be a way to do part 2 without a macro... but since I was racing instead of pondering, I built a macro

 

Spoiler
Fairly simple workflow
 

simple iterative macrosimple iterative macroworkflowworkflow

CoG
14 - Magnetar

@clmc9601

Same! Although your solution is much more elegant than mine.

Spoiler
Macro:
Screenshot Macro.png
Main Workflow:
Screenshot.png
gawa
16 - Nebula
16 - Nebula

@CoG @clmc9601 

Similar to yours!

Spoiler
image.png

 

phottovy
13 - Pulsar
13 - Pulsar

I went the macro route as well.

 

Spoiler
04.png


Macro.png
JeffF
Alteryx
Alteryx
Spoiler
Macro
2023_AoC_Day4_JeffF_Macro.png

Workflow
2023_AoC_Day4_JeffF.png
Tokimatsu
12 - Quasar

 My 1st macro on AoC 2023.

Spoiler
スクリーンショット 2023-12-04 153422.png
Yoshiro_Fujimori
15 - Aurora

Not a fancy workflow at all, but al least it worked😅.

Spoiler
Workflow (Main)
AoC04_Main.png
Workflow (Macro)
AoC04_Macro.png
DaisukeTsuchiya
14 - Magnetar

I spent the time to understand and create logic for part2.

Spoiler
WF
スクリーンショット 2023-12-05 071631.png


Macro

スクリーンショット 2023-12-05 071730.png






kelsey_kincaid
12 - Quasar
12 - Quasar

This one was frustrating, because I had the right idea from the beginning but made a lot of mistakes along the way. I'll let this serve as my annual reminder that generating a lot of rows is often not the best approach, especially with Advent of Code!

 

Spoiler
Part 1: Found the points for each card by taking the 2^(num_matches - 1)

Part 2:
 
 This was a journey. I started by spinning my wheels on an iterative macro that worked on the sample data AFTER I corrected a lot of silly mistakes. I wish I could recall what those were now, but a lot of time has passed since then 😅

Once I got my macro working on the sample data, I tried the production data. I quickly realized that my approach was flawed, because the iterations were taking a long time to process. My initial approach was to use Generate Rows to create a brand new card for each copy won. I realized that I didn't actually need to create a copy of the card - I just needed to know how many would be generated. This led me to my final solution, which was to process each card individually and determine how many of the other cards it would generate (I'm confusing myself even explaining it). 

I agree with @clmc9601 that there HAS to be a way to do it without a macro, but I might leave that pondering until tomorrow.

Main Workflow: 
AOCDay4-MainWorkflow.png

Macro:
AOCDay4-FinalMacro.png

First Macro Using Generate Rows: This was going to take forever to run. Very brute force approach in hindsight.

AOCDay4-BruteForceMacro.png

 

Labels
Top Solution Authors