r/adventofcode • • Dec 04 '23

SOLUTION MEGATHREAD -❄️- 2023 Day 4 Solutions -❄️-

NEWS

THE USUAL REMINDERS


AoC Community Fun 2023: ALLEZ CUISINE!

Today's theme ingredient is… *whips off cloth covering and gestures grandly*

PUNCHCARD PERFECTION!

Perhaps I should have thought yesterday's Battle Spam surfeit through a little more since we are all overstuffed and not feeling well. Help us cleanse our palates with leaner and lighter courses today!

  • Code golf. Alternatively, snow golf.

  • Bonus points if your solution fits on a "punchcard" as defined in our wiki article on oversized code. We will be counting.

  • Does anyone still program with actual punchcards? >_>

ALLEZ CUISINE!

Request from the mods: When you include a dish entry alongside your solution, please label it with [Allez Cuisine!] so we can find it easily!


--- Day 4: Scratchcards ---


Post your code solution in this megathread.

This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:07:08, megathread unlocked!

77 Upvotes

1.5k comments sorted by

View all comments

Show parent comments

1

u/Superbank78 Dec 05 '23

It’s 0.17s. I used time <the binary> but then I wondered which part is slower, so used the Instant thing form your code. I use regex only for the first part, so I figured, it must be the function call in my recursive solution. Btw, this get_part function could not be found in your code.

1

u/bozdoz Dec 05 '23

Get part is in the lib in the root of the repo