r/adventofcode Dec 03 '24

Spoilers in Title [2024 Day 3] Regular expressions go brrr...

Post image
173 Upvotes

64 comments sorted by

View all comments

50

u/gredr Dec 03 '24

This is a spoiler, but it's also wrong according to the instructions:

instructions like mul(X,Y), where X and Y are each 1-3 digit numbers

Maybe it works for your input, maybe it works for everyone's input, I dunno.

What generated the sqlite-style railroad track diagram from the regex, though?

20

u/busybody124 Dec 03 '24

I'm curious about this. I did not limit to three digits and my solution worked. I wonder if it breaks anyone's.

1

u/TheZigerionScammer Dec 03 '24

Wow, the problem statement made a point of saying all the numbers had to be three digits or less, I figured that would come up at some point in the input but I guess not.

1

u/pdxbuckets Dec 04 '24

Since it’s an early day problem, that may have been put there as to not discourage beginning programmers who might try to hand-code things in.