General Discussions

Discuss a wide range of topics! Questions about the Alteryx Platform should be directed to the appropriate Product discussion forum.

Advent of Code 2021 Day 6 (BaseA Style)

jdunkerley79
16 - Nebula
16 - Nebula

Discussion thread for day 6 of the Advent of Code - https://adventofcode.com/2021/day/6

 

JessL_0-1638911708532.jpeg

 

22 REPLIES 22
cgoodman3
13 - Pulsar
13 - Pulsar

Shortest gap between * and ** today, and fastest overall solve (started at 5:15am) (excluding day 1 where I can't remember when I started, but was probably the fastest day overall).

 

 

Spoiler
Workflow:cgoodman3_1-1638769472513.png

Macro:

cgoodman3_2-1638769724568.png

It was much simpler than I thought, I was imagining that we were going to head back into monitoring germinating flowers in space (I think 2018?), and that the part two logic wouldn't just be a case of iterating over more days (added interface tool after the solve), but instead that there would be some need to keep track of generations as older fish might end up with longer gestation periods or something like that. So far AoC is being kind...

 

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
bflick
7 - Meteor

Tried to do it without an iterative macro, but couldn't figure it out. Looking forward to seeing if anyone does.

Spoiler
Spoiler
bflick_0-1638770346781.png

 

bflick_1-1638770357702.png

 

cgoodman3
13 - Pulsar
13 - Pulsar

@bflick good to see another PwC’er at the top of the leaderboard 👏

 

Spoiler
Looks like we both applied the same logic, which made the part two solve really easy. Reading on Reddit after the solve it looks like a lot of people went down the route of exponentially increasing arrays/strings and wondered why after 256 days it was slowing down!
Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
bflick
7 - Meteor
Spoiler
My iterative macro first attempt was creating a giant list, but it would slow like crazy in the 30 day range. Turns out optimizing made it way easier!
NicoleJohnson
14 - Magnetar
14 - Magnetar

I'm sure there is a math way to solve this, and given enough time I am sure I could have googled it... but today is not that day. Iterative macro it is!

 

Spoiler
Full disclosure, this was my second iterative macro... the first one was REALLY slow. But while I was waiting for it to run for Day 2, I figured out a way faster way to solve for both, using one macro with a configurable limit (same as @cgoodman3 & @bflick , looks like!) The trick for me was realizing I didn't have to parse an exponentially growing number of records. I could just count the number of instances of each number, use my iterative macro to adjust them down one (and add an 8 for any 0's) and then re-count my numbers and iterate again. 

NicoleJohnson_0-1638771970732.png

And the macro...

NicoleJohnson_1-1638771995571.png

 

Super stoked about how this one ended up. Only 14 tools used, and the 256 day iteration runs in less than 1 second!! I love it when an iterative macro plan comes together...

 

Cheers! 

NJ

clmc9601
12 - Quasar

Wow, the lanternfish really did take over...

 

Spoiler
I started with the approach of exponentially increasing the number of rows, but that would have taken all night to finish! Here's my updated version. Looks like it's pretty similar to the first several.

Screen Shot 2021-12-05 at 11.25.11 PM.pngScreen Shot 2021-12-05 at 11.25.25 PM.png
afv2688
16 - Nebula
16 - Nebula
Spoiler
Built them together on a batch macro to get both results

Untitled.png
patrick_digan
16 - Nebula
16 - Nebula
Spoiler
Workflow:
patrick_digan_0-1638795967376.png
Iterative Macro:
patrick_digan_1-1638795992457.png

 

AkimasaKajitani
15 - Aurora

Today is reflection.

 

 

Spoiler
For star1, I made a simple iterative macro. It works well for star1.

AkimasaKajitani_0-1638796909930.png


But at star2, it takes too long time and finally this macro could not output the result. Because too many data kept me away.

I didn't become aware of a simple thing!

My latest macro is as follows.
AkimasaKajitani_1-1638797200239.png

After finishing the result, I made the macro bellow to be able to change the iterative count.

AkimasaKajitani_3-1638797340207.png

 


 

Final Workflow :

AkimasaKajitani_4-1638797387161.png

 

GitHub

https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2021