Part 1 was pretty straightforward, and Part 2 was in my mind as well. Took a lot of debugging to find my mistake. Anyhow. Finally securing a Part 2 win :-)
Brute force or bust for part 2. Tracking down bugs in large conditional if statements will always be the bain of my existence
I went to brute force approach.
Part 1 macro:
This one didn't click for me. Struggled for a long time before coming up with a clunky solution. As I cleaned it to post here, turns out half of it was unnecessary 😣😂
I overcomplicated things for part 2 and that costed a lot of times.
Part 2 is, upon hindsight, not that complicated had I not overcomplicated things.
Day 8 done ! ✔️
Here is my monster ! Not sure it's worth explaining as it should have a disclaimer "Don't do that at home, it has been performed by professionals." !
Happy with this one today, quite clean and concise for the challenge. For both parts 1 & 2, each data stream is a different cardinal direction.
I've added my golf today, but happier with my first solution as it was more computationally efficient. It had more tools but ran faster due to paring down the data properly with filters!
Golf:
Hi All, this was my solution for Day8.
Definitely not competing for tool golf today, but I didn't have too much trouble
I have a habit of using A LOT of tools it would appear but I really like seeing each step of the way and being certain the logic is working the way I'm visualising the problem in my head. Need to dig into some other solutions to see how they've possibly been done more efficiently than my works of art 🤣 🎅
A closer look :
Focused on creating categories for each point (left, right, up, down) with help of generate rows. For P1, I created a boundary with values of -1 to count those. For P2, took me a while, but had to bucket each category. Got values greater than no problem, just had to do running total and first record on current point then union.
Tool golf version : 9 tools !
Part 2 Macro:
Workflow:
Another day, another unnecessary and hideous macro. I'm having fun nobody can stop me
That felt inelegant
Finally got today's done! Spent 2.5 hours trying to debug my macros only to realise I was leaving my RecordID field in my 'left' count...
Column movement checker:
Row movement checker:
I am totally proud of myself for solving today's challenge:)
Scraping by now, just want the answer, not care about the efficiency anymore 😅
1. split to x,y coordination. create for list x and y.2. use left for top, left. and right for down, right3. use regex_countmatches to count more than 14. merge with edge and count record.
part2:1. get the list. 2. remove unnecessary item, descending and compare3. sum the count and get result.
Super messy solution - well at least the weekend is ahead, and time for refactoring ...
Teh data prep separates this in to row-wise and column-wise trees.The second phase then does a simple check and counts
This is the macro in the middle the processes ever subset of the strings:
Part 2 is just a slightly different sum on the same data
just submitting my backlog of old challenges