Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2024/day/3
Not perfect but works :P
Quite complicated approach but at least I got there :D
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!
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.
My solution.
I usually set "group by [RecordID]" for all cases in Multi-Row Formula, but this time it was a pitfall...