Discussion thread for day 4 of the Advent of Code - https://adventofcode.com/2023/day/4
Forgot to post my solution last night after (temporarily) giving up on the Python solution I attempted after solving in Alteryx.
Anyway, I used an iterative macro for part 2, and I don't regret it. Sorry not sorry.
Too many people mentioning iterative macro crashing their sys. I refused to use a macro. Runtime = 0.5 sec
Tried to refine, but not getting much better.
First day that requires a macro - this is going to quickly become normal I reckon!
@clmc9601 - very elegant - I tackled the inner macro differently but I see why yours works!
Very grateful to @patrick_digan , who showed me the magical use of the multirow formula tool during the Intcode fiasco of 2019
I did use what appears to be a useless summarize tool to figure out how many rows above I'd need to be counting. And I figured out the logic by modeling the sample data in Excel (whee, typing x into columns and then adding up and trying to discern a pattern!)
The logic, as I saw it, was that for a row above to add records to the current row, the number of cards generated for that row above must be greater than or equal to the numbers of rows above. For example, for 3 rows above, there need to be 3 or more generate cards to touch the current row.
Not sure if it's the best way to solve this, and it did work and no macros. And my part 3 is efficient with only three tools (one of which isn't needed after the first run)
My solution.