Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2021 Day 3 (BaseA style) - Binary Diagnostic

jdunkerley79
ACE Emeritus
ACE Emeritus

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

18 REPLIES 18
AkimasaKajitani
17 - Castor
17 - Castor

The challenge 1 is very simple. But it took long time for challenge 2.

 

Spoiler
The difference between the two macros is in the settings of one tool.

AkimasaKajitani_0-1638544710831.png
Macro
AkimasaKajitani_1-1638544812783.png

 

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

JoshuaB
Alteryx Product Evangelist
Alteryx Product Evangelist

I am trying to expand my thinking around the design patterns for these sort of problems that are recursive. Any other ideas instead of the straight-forward iterative macro? We have so many analytical problems like this that are path oriented meaning ok find the first number THEN do this this then do this. I want to be able to do that in one shot 🙂

Joshua Burkhow | Chief Evangelist @ Alteryx | Follow me on LinkedIn and Twitter
estherb47
15 - Aurora
15 - Aurora

Will add my solution later. To get an answer quickly, I created an iterative macro, copied it, and just changed the logic for the lower numbers.

danilang
19 - Altair
19 - Altair

And so begins the descent into madness!!

Spoiler
First day where my initial attempt to solve part 2 worked on the sample data, but not the full set

danilang_0-1638629430289.png
danilang_1-1638629584775.png

Dan

Jean-Balteryx
16 - Nebula
16 - Nebula

Iterative for day 3, it escalated quickly ...

 

Built two different macros for part 2 with one slight change but I think it can be optimised using only one macro.

 

JeanBalteryx_0-1638649971118.png

 

JeanBalteryx_1-1638650011845.png

 

JeanBalteryx_2-1638650055363.png

 

joshbennett
11 - Bolide
11 - Bolide

Gotta love iterative macros on day 3...

 

This one was fun!

 

Spoiler
joshbennett_0-1638862009790.png

joshbennett_1-1638862028136.png

 

 

SeanAdams
17 - Castor
17 - Castor

I followed a very similar route to @bflick and @cgoodman3 

 

Spoiler
Similar to @bflick  - instead of using a frequency analysis - I used an average with a rounding - should have used a mode though, that would have been more sensible.

Also used the inverse of the average to filter for the min vs. max in part 2 (O2 vs. CO2)

SeanAdams_0-1639101764548.png

 

Here's the macro that does the work - iterative macro

SeanAdams_1-1639101843381.png

 

Mchappell67
9 - Comet

This probably took me WAAAYYY longer than it should have, but it's my first macro, and an iterative one at that!  Pretty happy with the results after comparing to what other people did.  The part that actually hung me up for too long was the case where the bit counts were equal for a particular position; had to read the problem/example statement a bit closer.... Oh, well, finally figured it out.

 

Spoiler
Mchappell67_0-1639452051211.png

 

Mchappell67_1-1639452077819.png

 

caitlynmcintyre
9 - Comet

I really liked this one and despite trying desperately not to, I learned to use iterative macros

Spoiler
caitlynmcintyre_0-1639625957839.png

Macro: i used text input because lazy

caitlynmcintyre_0-1639626058038.png

 

Labels