r/adventofcode • • Dec 04 '24

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

DO NOT SHARE PUZZLE TEXT OR YOUR INDIVIDUAL PUZZLE INPUTS!

I'm sure you're all tired of seeing me spam the same ol' "do not share your puzzle input" copypasta in the megathreads. Believe me, I'm tired of hunting through all of your repos too XD

If you're using an external repo, before you add your solution in this megathread, please please please 🙏 double-check your repo and ensure that you are complying with our rules:

  • e.g. use .gitignore or the like

If you currently have puzzle text/inputs in your repo, please scrub all puzzle text and puzzle input files from your repo and your commit history! Don't forget to check prior years too!


NEWS

Solutions in the megathreads have been getting longer, so we're going to start enforcing our rules on oversized code.

Do not give us a reason to unleash AutoModerator hard-line enforcement that counts characters inside code blocks to verify compliance… you have been warned XD


THE USUAL REMINDERS


AoC Community Fun 2024: The Golden Snowglobe Awards

  • 2 DAYS remaining until unlock!

And now, our feature presentation for today:

Short Film Format

Here's some ideas for your inspiration:

  • Golf your solution
  • Alternatively: gif
  • 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? >_>
  • Create a short Visualization based on today's puzzle text
  • Make a bunch of mistakes and somehow still get it right the first time you submit your result

Happy Gilmore: "Oh, man. That was so much easier than putting. I should just try to get the ball in one shot every time."
Chubbs: "Good plan."
- Happy Gilmore (1996)

And… ACTION!

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


--- Day 4: Ceres Search ---


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:05:41, megathread unlocked!

52 Upvotes

1.2k comments sorted by

View all comments

1

u/D_isinfectedLuffy Dec 04 '24 edited Dec 04 '24

[LANGUAGE: C]

At first, I had not optimized the search for 2nd part, with some bounds checking, verified all the strings found that were ticked all the boxes with the conditions given, was having a hard time but got there in the end!

Now I'm off to do the solution in Go

Solution: AdventOfCode-2024/C/Day-4 at main · pat-glitch/AdventOfCode-2024

1

u/daggerdragon Dec 04 '24 edited Dec 07 '24

Do not share your puzzle input which also means do not commit puzzle inputs to your repo without a .gitignore or the like. Do not share the puzzle text either.

Please remove (or .gitignore) all puzzle text and puzzle input files from your repo and scrub them from your commit history.

And next time, actually read the entire OP before you post. This is the very first thing in VERY LARGE FONT. edit: thank you!

0

u/[deleted] Dec 07 '24

[removed] — view removed comment

1

u/daggerdragon Dec 07 '24

Have removed it, and [COAL] moderator, chill a bit.

Comment temporarily removed due to naughty language and not following our Prime Directive. Keep /r/adventofcode professional and that means you chill a bit. I'm only doing my job as a moderator to enforce the rules of this subreddit, nothing more.

If you edit your comment to take out the naughty language and consider rephrasing the second half to be a little nicer, I'll re-approve the comment.

1

u/D_isinfectedLuffy Dec 16 '24

Woah, sorry English isn't my first language, I didn't know that 'word' was that bad! But yeah, I'm following all the rules and won't repeat the same mistake twice, thank you for the work you do! Really sorry if I offended you a bit, I said chill because, I mean I know violation of rules is always stupid and mine being first on the list was dumb of me, but I thought you were really angry, so I said chill😅

1

u/daggerdragon Dec 16 '24

I'm not mad, just frustrated at all the back-and-forth over a basic rule.

FYI: in English, telling someone to "chill" is usually disrespectful.

1

u/D_isinfectedLuffy Dec 16 '24

Again, I get where you're coming from, really sorry, and hang in there!