Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2024/day/3
Such a relief when regex works the way I intended on the first try 😅
Refreshing on RegEx ahead of Advent of Code has already paid off this year!
I had some trouble with my code, initially, but managed to identify and resolve the bugs I ran into quickly
It's about 'Parse'.
(Edit)
Tool golf version: Part1=3 tools, Part2=3 tools
I love seeing the cryptic and quickly typed column names and annotations AoCers use when racing on the leaderboard. 😂 not maintainable, but so relatable and funny
Solved!
I should become closer friends with the RegEx tool.
But to simplify the regex, I used the Find Replace tool.
The RegEx on this one was beyond my normal reach, but we got there.
One useful trick was
regex tools win the race today.
Had the right answer, but did something dumb and wasted 15 minutes troubleshooting. #classic
So as punishment for doing dumb things, I tool golf-ed it down to 4 tool solution that works for both parts at the same time. 😋
Still loving the new Expression Editor in Multi-Row Formula tool in 24.2!
RegEx and I definitely get along better when I am wide awake... went through way more iterations than I care to admit before I realized what I actually needed to type to get this to work the way I wanted lol.
I was trying to do the subtraction between Dont and Do but get stuck.So I have do between Do and Dont after adding one more Do at the begining of the Input.
Fun.
I can't get along with RegEx...
Wow my regex is dustier than the elf on the shelf...
My solution.
Lovely bit of regex today
Not perfect but works :P
This is good for regex.
Quite complicated approach but at least I got there
Nice start of the day wih a Regex Expression
I loved using my Regex skills. I have not yet attempted tool golf, but I can see how it can be done. The spoiler includes both stars!
Day 3 in the bag! Lovely little treat after yesterday's cheeky part 2.
Very nice Regex challenge today
do\(\)|don't\(\)|mul\(\d+,\d+\)​
Number 1: IF StartsWith([data], "mul") THEN ToNumber(REGEX_Replace([data], "mul\((\d+),(\d+)\)", "$1")) ELSE 0 ENDIF Number 2: IF StartsWith([data], "mul") THEN ToNumber(REGEX_Replace([data], "mul\((\d+),(\d+)\)", "$2")) ELSE 0 ENDIF​
IF [RecordID] = 1 THEN "On" ELSEIF [data] = "don't()" THEN "Off" ELSEIF [data] = "do()" THEN "On" ELSE [Row-1:Status] ENDIF
Regex fun, felt a lot less painful than yesterday but feel I may be being lulled in to a false sense of security.
I usually set "group by [RecordID]" for all cases in Multi-Row Formula, but this time it was a pitfall...
I'm sure there's a 3 tool solution out there...edit: of course @gawa has it!
@Samantha_Jayne love that our workflows are basically identical