Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.
alteryx Community

# General Discussions

Discuss any topics that are not product-specific here.

## Advent of Code 2020 - BaseA Style (Day 2)

16 - Nebula

17 REPLIES 17
ACE Emeritus

... When those workflows start running and carols start humming, we sing of good CHEEEEERRRR!!

It's the MOST wonderful TIIIIIIIIME of the YEARRRRRR....

Here's my solutions so far!! Goal this year is to make it to 25* = 8 more than last year. And am 100% going to play my West Coast time zone advantage to my benefit. #ruthless.

Day 1 Solution:

Spoiler
I ain't no quitter, so even though I solved this one pretty quickly with an Append strategy, I know from a few years on this AoC adventure that the efficient solution is the best solution in the long run, so I found a better way to do it in the end.

My first attempt chose the "append all the numbers to all the numbers" route, which in the grand scheme of things only cost me about 0.2 extra seconds and gave me the thrilling "you have earned a gold star" message... BUT I HAVE LEARNED MY LESSON, Advent of Code. So I shaved ~0.2 seconds off my time by implementing a Formula at the beginning to determine eligible pairs, and then resorting to the Append method only for Part 2. Efficiency is King.

Day 2 Solution:

Spoiler
Ahhh, RegEx. What can you NOT do?

Filter formulas were the key here - and an excellent example of the power of Alteryx to do a lot of tricky things at once. With some strategic RegEx parsing, I was able to build quick formulas to determine not only those instances where the occurrences of letters were within the upper and lower bounds, but also to calculate the positions in which they occur for Part 2.

I find myself so incredibly eager for the next challenge... I know in about a week, this will no longer be the case (IntCode-from-2019, you are the thing of nightmares)... but the delusion of success is bound to endure for at least a few more days, so in the meantime, ONWARD!!

Cheers,

NJ

ACE Emeritus

The early morning starts to do not help my brain - no difference between +1 and -1 it'll be fine...

Here's my day 2:

Spoiler

ACE Emeritus

@jdunkerley79  Methinks my late night brain definitely works the same as your early morning brain then, since I also added my 1's before I took them away.

Oops.

16 - Nebula

Day 2 solution. Literally first thing in the morning !

Spoiler
13 - Pulsar

Day 2

Spoiler

So glad there's no sign of intcode this year....

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
ACE Emeritus

Day 2

Spoiler

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
18 - Pollux

I share your optimism @NicoleJohnson and and also your sense of dread remembering intcode from last year.  Alteryx makes a lot of things incredibly easy, but recursively modifying your inputs is not one of them.

Spoiler

No messy SubString() functions for me(Yay), but more tools(boo)

Dan

7 - Meteor

A bit clunky... will take a keen interest in the other solutions to see how i could have done this better! (But it gets the right answers 😎)

Spoiler

15 - Aurora

Hi all,

This is my Day 2.

Probably putting the formulas in the filters may be the way to go, but it works.

Spoiler

Labels