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 15 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

15 REPLIES 15
alisonpitt
11 - Bolide

Like others said, this was definitely one where reading the question took the longest. Otherwise, this was a nice quick one...the calm before the storm?

Spoiler
This was the challenge where I realized that I use 2 tools in every workflow now: RegEx (tokenize to rows) and Multi-Row Formula. This was definitely a regex-heavy solution!
15-ap.png
mmontgomery
11 - Bolide
11 - Bolide

P1 was straightforward, P2 in spoiler

Spoiler
P1 was an iterative macro to get the next value without much of a hassle.

For P2, I kept breaking out into separate parts to handle the various cases:
1. No box already determined
2. Match on a box
2a. Match on a fellow member in the box (split into = and -)
2b. No match on a fellow member in the box and rule written accordingly
2c. Remaining boxes with members in them
3. Bring it all together and have the macro run as long as there were rows
D15P1.pngD15.pngD15P2.png
DataNath
17 - Castor
17 - Castor

Finally caught up on Day 15! Took me way too long to troubleshoot but was good to stick at this and finally get it done.

 

Spoiler
Day15WF.png

Day15Iterative.png
estherb47
15 - Aurora
15 - Aurora

Part 1 was so easy, but my data contained some edge cases that messed with my first approaches.

 

I had created a macro for the HASH process, but it became too difficult to debug when it came to part 2, so abandoned that approach. Hints to my success in the spoiler.

 

Spoiler
If you're just looking for "xt7" and your data contain "rxt7", you won't get the correct answer. Think in ways that define each pattern as whole patterns, not parts of patterns.

You can get away with simple text formulas and not solely on regular expressions to get this to work, which is faster in the end as I've found it.
Carolyn
12 - Quasar
12 - Quasar

Solved! I spent longer than I'm going to admit tracking down a mistake I made. Instead of doing a proper RegEx parse (or other RegEx function) for the lens type + power (e.g. abc=2), when I was determining if a label was already present in the box, I just used the Left function with a value of 2, which worked beautifully with the sample data.. and it does not work beautifully with the real data, since I was saying that tcp = tccm and then replacing it.

 

Spoiler
I ended up rebuilding all of Part 2 and got a much more beautiful and faster workflow. I picked a box and looked at everything that it was doing as a single macro iteration, which was way faster than going through all 4k "steps" one at a time. It also didn't even need to be a macro but I had already built it when I realized it was overkill. We're calling it all learning and I'm moving on :)

Canvas 1.png


Canvas 2.png

Tokimatsu
12 - Quasar

Once I understood the problem, I was able to solve it neatly.

Spoiler
スクリーンショット 2024-01-05 160248.png

Labels
Top Solution Authors