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 2023 Day 9 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

28 REPLIES 28
CoG
14 - Magnetar

Another breath of fresh air. Very satisfying problem to solve. Reminded me of my high school days, solving for the degree of a polynomial sequence (That knowledge didn't help a ton, but those were happy memories for a weirdo like me)!

Spoiler
Main Workflow:
Main Workflow.png
Batch Macro (For part 1):
Part 1 Batch.png
"Reverse" Batch Macro (For part 2):
Part 2 Batch.png
Iterative Macro (Finds 'Predictions' for given input row):
Iterative Macro.png
phottovy
13 - Pulsar
13 - Pulsar

Why does this feel like the calm before the storm...

 

Spoiler
09.png

Macro:
09_Macro.png
gawa
16 - Nebula
16 - Nebula

Today's problem was not as difficult as yesterday.

Spoiler
image.png

 

DaisukeTsuchiya
14 - Magnetar

Today's one is easier than yesterday and can go out now!

Spoiler
I reverse the input data for Part2 and it works well!
スクリーンショット 2023-12-09 150855.png
スクリーンショット 2023-12-09 150920.png
clmc9601
13 - Pulsar
13 - Pulsar

Pretty happy with my simple-looking no macro solution. Naturally, there's a long formula hidden inside. :) I like to generate formulas like that in Excel so there's fewer opportunities for typos and so that I can make changes efficiently.

 

Spoiler
It's all thanks to @NicoleJ and GetPart() which means I can FINALLY iterate through a sequence of multiple numbers all stored in a single cell. Would not recommend for a real automation solution... but I have always wanted to do something like this for AoC. Too messy with left() and right() and regex_replace().

Screenshot 2023-12-09 001821.png

 

kelsey_kincaid
12 - Quasar
12 - Quasar

Overall, I'm pretty happy with this one. Part 2 took me longer than it should have, because I made a small change right after reading the problem that threw off the rest of my logic. It took me awhile to remember I'd done that and to fix it. Regardless, I was able to use the same exact macro for both part 1 and part 2, which I count as a win in AOC.

 

Spoiler
Part 1: I used an iterative macro to difference the data. Then I took that output and found the last row's value across iterations and summed them together with the last number in the sequence.

Part 2: Same approach, but I reversed the order of the data going into the macro. At some point I thought it was a good idea to reverse what value got subtracted from what value, which was a bad idea, and is what threw off my answer for part 2. I couldn't figure out why the identical logic I used for part 1 wasn't working, and it is because I was indeed NOT using identical logic. Regardless of how quickly (or slowly) I got there, it was refreshing for the answer to be as simple as reversing the sort order of the values.

Workflow:
D9.png

Macro:
D9Macro.png

EDIT: Super intrigued by your approach @clmc9601 ! I can't dive into it right now because I'm on 2023.1 and missing one of the formulas you used, but I'm fascinated.

 

AkimasaKajitani
17 - Castor
17 - Castor

My solution. I've been recalling how to make the Iterative macro more and more.

 

Spoiler
I heard that part 2 is reverse of the part 1 from @DaisukeTsuchiya , so I made the reverse input version for part 2.

AoC_2023_09_02.png

Part 1 Macro

AoC_2023_09_03.png
Part 2 Macro
 I removed the result calculate part from part 1 macro.


AoC_2023_09_04.png


Part 2 Reverse version macro(I only modified the final expressions. )


AoC_2023_09_05.png



  

Yoshiro_Fujimori
15 - Aurora

I don't have much chances to use Iterative macro in my daily business.

But this month I may use more cases than all I have used in the past :)

 

Spoiler
Main
Main.png

Batch for Part 1
Batch_Part1.png

Batch for Part 2
Batch_Part2.png

Iterative Macro to get the Next Value
getNextValue.png
AkimasaKajitani
17 - Castor
17 - Castor

I remake the workflow. I organize my workflow by working only what I should do.

 

Spoiler
At part 2, I simply reverse the input from the part 1.

スクリーンショット 2023-12-09 220513.png


スクリーンショット 2023-12-09 220525.png


Labels