Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2021/day/3
They're definitely starting to ramp up. Had a lot of fun with this one.
Note to self: Must not make assumptions!
Macro:
The macro essentially follows the same process as the main workflow to identify the most common value (1,0) at each bit position, but uses a substring expression to move along the string to find that iterations' most common value and then filters it out. Repeating the pattern until there is only one row left and converts to int.
It was handy to recall the BinToInt() function from previous years otherwise I would have manually converted things like 10100 to 20!
@bflick I like your part 1 solve as it’s nice and simple and makes sense that epsilon and gamma are anti versions of each other. I’m going to tell myself that I took the long route for part 1 as I knew it would come in handy for part 2;)
I will admit the solutions that got me the stars was not my best work... but I went back after the fact and cleaned it all up with a much more straightforward solution that was actually very similar to @bflick !
I'm far too mortified of my first solution to post it here, so this is the nicely cleaned up version after I had time to think through a better strategy.
And the macro to do the Part 2 part (I had two separate macros the first time, since I didn't want to waste time figuring out how to get the same iterative macro to do both the CO2 Scrubber part and the Oxygen Generator part... happy to say I did find a way to do so eventually!) Oxygen Generator does the same thing as CO2 Scrubber section, just for the alternate column.
I'm sensing a binary theme so far this year? Definitely getting more traction out of all these sweet binary formulas in Alteryx than I have EVER used them before!!
Cheers!
NJ
Think I might have used too many joins...
@bflick Nice solution! I always forget that mode is an option....
Ok, now we are talking... took me longer than I thought
Thank you Detour Tool!