Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 2 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Spoiler
 

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

65 REPLIES 65
patrick_digan
17 - Castor
17 - Castor

Very similar to others

Spoiler
image.png
gawa
16 - Nebula
16 - Nebula

Tool golf version. 9 tools excluding input tool.

Spoiler
image.png
mceleavey
17 - Castor
17 - Castor

Easier than day 1 and I'm still in it...

Spoiler
Screenshot 2023-12-02 115329.png
A straightforward parsing process to begin with. I used text to columns to isolate the Game ID, then split to rows on the game phase. I then used a multi-row to assign a phase number, then I used text to columns and regex to strip out the bits I needed. 
For part one, it was then a matter of cross-tabbing into an aggregate set by Game and phase, then stripping out the actual numeric value of the game. I then used a filter to isolate those that did not violate the limits, then used the join to join those game numbers that had a violation, so I took the ones on the left output, those being the ones that did not exceed the limits, then simply summed the game numbers.
Part two was a simple grouping, then applying the multi-row power calculation (grouped by game ID), then taking the max of those and summing the total.

Go #TeamMcEleavey!



Bulien

SeanAdams
17 - Castor
17 - Castor

I was looking for the sneaky trick in part 2 but was pleasantly surprised that there was none.

Today was a good day to get things like setting up a GIT repo; making a donation to AOC to get that ++ tag etc.

 

Spoiler

2023-12-02_07-49-11.png



This solution is 2 parts:
- the parser (the brush icon) cleans up the data to the shape we need it to start doing the job
- then we can start doing the calc
- and on the end you'll see the test harness that keeps me honest as I try different things.

Here's the parser - super rudimentary:
Screenshot 2023-12-02 075116.png



SeanAdams
17 - Castor
17 - Castor

thank you for continuing to point out where we can experiment with new features @NicoleJ  - it really does help to highlight these new capabilities and give folk muscle-memory to try them.

 

I'm sure you're looking out for opportunities for the Control Containers to shine!

SeanAdams
17 - Castor
17 - Castor

good on you for dual-solving in Designer Cloud @AkimasaKajitani !

rachel_k
Alteryx Alumni (Retired)

Similar approach to others.  After yesterday, I felt like I had to check for any unexpected colors

Spoiler
day2.png
mmontgomery
11 - Bolide
11 - Bolide

W00t on the problem being very procedural!

Spoiler
Day2.png
Samantha_Jayne
Alteryx
Alteryx
Spoiler
Day 2.png

Oh my goodness part 1 was a bit of a head twister with everything you have to check. Loved that part two was an easier one to solve. Will have a go at removing all the unnecessary tools I used later. Busy day. But glad I solved another day. Whoop.

Samantha Clifton
Alteryx
#alteryxrocks
AkimasaKajitani
17 - Castor
17 - Castor

Thanks! @SeanAdams  I think that we can solve the AoC with Designer Cloud until we need the Generate Row or Multi-Row Formula tool.

Labels
Top Solution Authors