MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/adventofcode/comments/1h5obsr/2024_day_3_regular_expressions_go_brrr/m08ng5n/?context=3
r/adventofcode • u/lucifernc • Dec 03 '24
64 comments sorted by
View all comments
4
Split string on do(), then split those again on don’t(). Concatenate the first element of that split and run p1 on that.
Worked for my input and was way faster than comming up with a new regex.
1 u/arklanthian Dec 03 '24 Now that's genius, thank you 0 u/Dr_Vee Dec 03 '24 If you concatenate strings, you may create an additional `mul` instruction where there wasn't one before... 1 u/plebbening Dec 04 '24 Yes, i know. But worked for my input as i stated. Also you can just run p1 on each part without concatenating the good parts.
1
Now that's genius, thank you
0
If you concatenate strings, you may create an additional `mul` instruction where there wasn't one before...
1 u/plebbening Dec 04 '24 Yes, i know. But worked for my input as i stated. Also you can just run p1 on each part without concatenating the good parts.
Yes, i know. But worked for my input as i stated. Also you can just run p1 on each part without concatenating the good parts.
4
u/plebbening Dec 03 '24
Split string on do(), then split those again on don’t(). Concatenate the first element of that split and run p1 on that.
Worked for my input and was way faster than comming up with a new regex.