Discussion thread for day 15 of the Advent of Code - https://adventofcode.com/2023/day/15
Today was a good confidence booster! I started by trying to avoid an iterative macro, but found the logic was more straightforward with a macro than without (at least to me). Now I want to go back and try a non-macro solution!
Part 1: The bulk of this logic was done in a simple multi-row formula tool with built-in Alteryx functions, which just felt so good. CharToInt() was so useful.
Part 2:After rereading the instructions approximately 15 times, I finally felt like I understood the problem. It luckily sounded much more complicated than it ended up being in practice.
Workflow:
Macro:
This was a fun one, once I figured out the instructions (which took me longer than I'd like to admit...). The method here is pretty much just brute force, so I won't share any further details as to algorithm. I think the workflow itself is a pretty cool use-case for creating conditional logic in Alteryx (i.e. update if row exists, add row if not)
I probably spent more time rereading the description than actually building my workflow.
P2 is hard to understand the problem.
It may take a bit long to understand what you are asked to solve in part2, but once you get it, logic would be simpler.
I read part 2 for 20+ times. to find out how to allocate the box.
and today also a non macro day.
Part 1 is straightforward. But Part 2 question text was too difficult to understand. I continued to search the box number.
Had to spend a good amount of time reading the situation again and again. although the part 1 was not complicated as excepted
Overall, a good challenge so far and got to know about the ASCII value
Formula use for part 1 - Mod(([Row-1:value] + CharToInt([data]))*17,256)
example if ASCII values a 97b 98c 99d 100e 101f 102= 61- 451 495 53t 116
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?
P1 was straightforward, P2 in spoiler
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.
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.
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.
Once I understood the problem, I was able to solve it neatly.