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

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

32 REPLIES 32
CoG
14 - Magnetar

My brain is dead, but boy was that a fun challenge and a great puzzle! Thinking through how to solve a problem of this magnitude was very exciting (... although I almost crashed my computer, jumping straight to the Generate Rows Tool... Next time I'll check how big the numbers are).

Spoiler
First problem used a standard macro:
Standard Macro.png
Second Part an Iterative Macro:
Iterative Macro.png
Both in a beautiful cascading chain (Main Workflow):
Main Screenshot.png
Tokimatsu
12 - Quasar

There may be many problems, but I solved them anyway.

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

gawa
16 - Nebula
16 - Nebula

Please don't ask me how my WF works, because I can't explain😂

0.9sec with AMP engine. 

Spoiler
I'm so tired...
image.png
gawa
16 - Nebula
16 - Nebula

I refined my WF, and now, I can explain how it works. Happy to achieve less than 1 sec!

Spoiler
image.png

image.png
DaisukeTsuchiya
13 - Pulsar

Part2 was so hard.

Spoiler
I spend a lot for Part2. I was suprised that the answer was matched luckly in the middle of development as a trial.
I wonder why it matched then I carefully checked the map file and got the concept.

I skip the complicated part in the workflow then add the records by investigating the map in Excel. My workflow needs to be configured when input is changed...

=> I revisit WF and update. Now I have a clear picture.

スクリーンショット 2023-12-06 094703.png


 <Macro Part1>

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


< Macro Part2>

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

 

patrick_digan
17 - Castor
17 - Castor

I feel good about my part 1 solve using my multi-row-field-column tool, but part 2 is one of those that you just find a way to solve and move on!

Spoiler
Part 1:
image.png

Part 2:
image.png
phottovy
13 - Pulsar
13 - Pulsar

Attached is my sort of cleaned up workflow: 

Spoiler
05.png

For part 1, I could have built an iterative macro but ended up reusing containers to accomplish the same thing.

For part 2, I had to adjust my approach quite a bit. There were simply way too many rows to send through my workflow so I eventually switched to a sampling approach. I would send random rows from each seed through my workflow and analyze which seeds and individual rows consistently had the lowest result. Eventually, I was able to isolate which seed had the lowest result and I was able to start sending ranges of approximately 250K- 500K rows through my workflow until I was able to isolate the lowest outcome. 
mmontgomery
11 - Bolide
11 - Bolide

No macro and 1 second to run. Ironically got p2 in a much faster time than P1.

 

Spoiler
P2 was a matter of finding a trend in the data at a large scale and then doing subsamples. I plotted random points and noticed it was always going up except for random drops. Once I found enough random drops, I found the min of those and then tested smaller subsets until I got it. ~1.5 hours for p1. ~30 min for p2
Day5.png
DavidP
17 - Castor
17 - Castor

Had to rethink my strategy for part 2 to think in ranges rather than lists. Rough steps are:

1. Check if start of seed range is within one of the source ranges

2. If true, check if the end is within that source range

3. If yes, happy days, assign the offset for the next level

4. If no, break the range into two -  the part that fits and the remainder

5. The remainder forms a new range on which to preform steps 1-4.

 

I used an iterative macro for steps 1-4 and then ran it for each mapping. Runtime 0.5 secs

 

Spoiler
aoc day5 iterative.pngaoc day5 wf.png
Labels