24
๐ท - 2024 DAY 3 SOLUTIONS -๐ท
(programming.dev)
An unofficial home for the advent of code community on programming.dev!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Solution Threads
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 |
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
Rust
Regex made this one pretty straightforward. The second part additionally looks for
do()
anddon't()
in the same regex, then we do a case distinction on the match.Our part1's are basically identical, but for part 2 I just regex deleted everything between
don
t()and
do() `, after sanitizing out the newlines.I guess it would have failed if my test data had a mul after the last dont, but it worked out, so good enough :)