Advent of Code 2024 Day 3 (BaseA Style)
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Alteryx Community Team
‎12-02-2024
09:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Discussion thread for day 3 of the Advent of Code - https://adventofcode.com/2024/day/3
Labels:
- Labels:
- Advent of Code
73 REPLIES 73
13 - Pulsar
‎12-02-2024
09:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Such a relief when regex works the way I intended on the first try 😅
Spoiler
Tokenize for the win! I'm very surprised there weren't any parsing tricks... that would have been very on brand for AoC.
 
12 - Quasar
‎12-02-2024
09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
CoG
14 - Magnetar
‎12-02-2024
09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I had some trouble with my code, initially, but managed to identify and resolve the bugs I ran into quickly
16 - Nebula
‎12-02-2024
09:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It's about 'Parse'.
Spoiler
When complicated parse is needed, Regex tool will do it perfectly.
Part1: We need to parse out all pattern mul({inetger},{integer}), but not knowing how many exist. In this case, we can use 'Tokenize' into rows.
Please be careful when regex expression includes meta characters, they must be escaped by backslash '\'.

Then, data can be further parsed into columns to extract 2 integer values.
Part2: We need to extract more patterns 'do()' and 'don't()' in addition to 'mul({integer},{integer})'. Regex can be modified to match any of those patterns by vertical bar like (pattern1|pattern2|....|pattern N)
Then, by using Multi Row Formula, we can identify which record is to be calculated.

Part1: We need to parse out all pattern mul({inetger},{integer}), but not knowing how many exist. In this case, we can use 'Tokenize' into rows.
Please be careful when regex expression includes meta characters, they must be escaped by backslash '\'.
Then, data can be further parsed into columns to extract 2 integer values.
Part2: We need to extract more patterns 'do()' and 'don't()' in addition to 'mul({integer},{integer})'. Regex can be modified to match any of those patterns by vertical bar like (pattern1|pattern2|....|pattern N)
Then, by using Multi Row Formula, we can identify which record is to be calculated.
(Edit)
Tool golf version: Part1=3 tools, Part2=3 tools
Spoiler
Formula tool is very powerful!

13 - Pulsar
‎12-02-2024
09:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
17 - Castor
‎12-02-2024
09:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Solved!
I should become closer friends with the RegEx tool.
Spoiler
But to simplify the regex, I used the Find Replace tool.
ScottLewis
11 - Bolide
‎12-02-2024
09:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The RegEx on this one was beyond my normal reach, but we got there.
One useful trick was
Spoiler
Replacing do() and don't() with single characters so you can use Parse on delimiter.
PangHC
12 - Quasar
‎12-02-2024
09:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
regex tools win the race today.
Alteryx
‎12-02-2024
10:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
 
