Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2024/day/3
Took awhile to battle against the mysterious art of regex, finally manage to tokenize.
Only now seeing @ScottLewis's suggestion on using replace first, how did I not think of it 😂
My attempt
D3
Solution
a disturbingly simple regex. the world must be imploding 🤣
Spent way longer than I care to admit stuck on some greedy quantifiers...
Solved! I did some Golfing - 6 total tools, 3 for each part. I enjoyed doing the RegEx parsing and math in the Formula/Multi-Formula Tools
I could use @NicoleJohnson's as an example for how to get the entire workflow down to 4 tools. I might do that later.
Solution:
Day 3 in the bag! Worth mentioning that I upgraded to 24.2 in the middle of Part 2, just so I could use the new expression editor with the multi-row formula tool! It was SO much better...
Okay, I have a bone to pick with this one . . . I knew my method was solid and couldn't figure out why it wasn't working until I noticed . . .
I think this is cheap and incorrect. Fight me.
RegEx for the win 😎
My Solution Below:
Day 3 in the books!
Brain didnt want to regex today, so while there is a lil bit here mainly just workarounds
The dos and don'ts were a tad tricky.
I took a long way round - going to go back and have a look at some of the pure regex solutions like @clmc9601
as always - full solutions are here: SeanAdams10/AdventOfCodePython: Advent of code challenges in Python - across multiple years
Tool golf was fun after wrapping my head around it. Starting to get festive.
No RegEx no star...
Marcus Alvim
Embarrassed I completely forgot to post my solution! ">😫
With that I just say..... Welcome to Advent of Code. Better get over it now because I assure you there are tons more where that came from! Great work overcoming the challenge!
Forgot to post day 1 and 2, but here is day 3
Also fun learning new capabilities with Regex!
Nice RegEx refresher to get in the groove
Way simpler than day 2 with the Regex tool
This Regex took longer than I thought it would!
Got this one after a bit.
Day 3!
Much better than day 2!