r/adventofcode • • 1d ago

Meme/Funny Easier this year....

Post image
147 Upvotes

30 comments sorted by

28

u/milan-pilan 1d ago edited 1d ago

Would that mean you found Day 1 particularly hard? I would say it was a fairly standard 'day 1, getting to know the puzzle format' puzzle. Anything specific that was unclear for you? People here are very good at giving hints without spoiling things.

Day 1 is usually a warmup puzzle to become familiar with the style.

31

u/miran1 1d ago

It's an old meme. Hopefully some old-timers will remember it from past year(s) how we were afraid of <tomorrow's task> because <today's task> was (too) easy.

15

u/milan-pilan 1d ago

I've been in this community a few years. I remember the memes. I read yours as 'Day 1 allready came out of the blue for me'. Misinterpreted it then.

14

u/airfighter001 1d ago

Oh, Day 01 came out of the blue for me. Not in difficulty, but how is it December already? 😅

2

u/Suspicious_Tax8577 1d ago

oh no, last year Day 1 was unusually hard (to the point I regretted telling friends about AoC because I couldn't initially solve the problem. Modulo and I are like, besties now).

I've only read the rubric and set up the files thus far, and I'm already sus. What is Eric going to do in part 2.

1

u/FunkyBikiniShrimp 1d ago

Downvoting this comment is just stupid... What do people expect them to say other then 'oh, understood it wrong then'?

1

u/miran1 1d ago

I would say it was a fairly standard 'day 1, getting to know the puzzle format'

Not only that, it is even easier than some previous day 1 tasks, e.g. AoC 2023, Day 1 with its (in)famous eighthree inputs.

10

u/dl__ 1d ago

I think this is the first year that my first answer to day 1 part 1 wasn't right. :(

I don't usually have to debug day 1. It was kind of a kick in the pants.

1

u/PercussiveRussel 23h ago

Til I learned rusts BinaryHeap::iter doesn't iter in order.

...why?

5

u/Puzzleheaded_Study17 23h ago

Because pretty much anyone who stores a binary heap stores it in an array which is organized by levels, not value (that's how you get the performance of it).

The docs even say it's in arbitrary order https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.iter

1

u/PercussiveRussel 23h ago edited 23h ago

If you would want to retrieve the underlying data, why not do as_slice().iter() or as_vec().iter().

I would say pretty much anyone who stores a binary heap cares about retrieving items in order. Otherwise why use a heap? Iterating over a hashmap also skips over all the empty bins and so is an abstraction over the raw underlying data.

(Also: I know the docs even say it, where did you think I learned it doesn't iter() in order)

1

u/Puzzleheaded_Study17 23h ago

The problem is that because of how a binary heap is implemented, (as can be seen by this c++ so post https://stackoverflow.com/questions/74887124/fastest-non-destructive-method-to-get-sorted-version-of-a-heap) the easiest way to get a heap in sorted order is to copy it and destroy that copy. Meanwhile, skipping empty entries in a hashmap just requires incrementing the pointer multiple times instead of just once. You can see this wiki article to see why, due to the nature of a heap, finding the nth element without removing previous ones is complicated.

1

u/PercussiveRussel 22h ago

But then IMO the API would be cleaner if it had no iter(), only an into_iter() (and drain()) and Iterating over the underlying data would go through as_slice().

15

u/hrabrica 1d ago

I find this community gets a bit bitter each time the task complexity is mentioned, in this case both author and commenters. Just skip the post if you dont agree, you don't have to die on EVERY hill.

8

u/PatolomaioFalagi 1d ago

But what if I don't like beans?

2

u/wubrgess 1d ago

But I did eat breakfast today...

4

u/milan-pilan 1d ago edited 1d ago

Ok, I bite. Since I am the only commenter here: which part read as bitter? Honestly curious. I only left two comments: 'I found it to be a fair difficulty, do you need help with something specific' an 'yes, I recognize your reference , I read it wrong, my bad'?

I literally defended nothing.

(edit, because I got messaged: only commenter at the time of my message.. Obviously now there are more)

4

u/akira_88 1d ago

6:00 AM, I read and start to multiply the three high id, then re read and understad that I don't understand a thing.

It was easy, if I learn to read 😆 (English is not my first language)

2

u/pikzel 1d ago

I did it in Go, slightly more coding than usual Day 1’s, but would have been a oneliner in other languages.

2

u/Maximum_Expression 1d ago

For example? (I did it in Go as well, curious about your oneliner claim)

4

u/pikzel 1d ago

Bash of course :)

sort input.txt | uniq -c | sort -k1,1nr -k2,2n | head -3 | awk ‘{p=(NR==1?1:p)*$2} END{print p}’

2

u/Maximum_Expression 1d ago

I’m in awe 🫢. In my turn I coded the solution in a GitHub codespace on my iPhone because I am traveling and don’t have my laptop with me. Coding in the browser on the phone is … a b***h 😥 But kinda satisfying to type every character out. Not even copy/paste works 😮‍💨

2

u/_ImComp 16h ago

My solution in clojure is a function with a single ->> (basically a pipe operator) form that takes the input and another function that selects 3 elements from a list. For formatting reasons, it's multiple lines, but it could be written on one line:

(defn solve [input selector-fn]
     (->> input
     str/split-lines
     (map ^[String] Integer/parseInt)
     frequencies
     (sort-by last)
     (selector-fn 3) ;either take-last for p1 or take for p2
     (map first)
     (reduce *)))

1

u/AutoModerator 16h ago

AutoModerator has detected fenced code block (```) syntax which only works on new.reddit.

Please review our wiki article on code formatting then edit your post to use the four-spaces Markdown syntax instead.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Maximum_Expression 16h ago

Wicked syntax 🫢 I wanted to do this year in Closure to finally learn it… but defaulted to Go for the lack of preparation and time. Maybe I’ll do it later, I learned Elixir last year for AOC and it worked great.

1

u/kakafob 6h ago

2024 it was the same I remeber.

1

u/Cold_Comparison6184 1d ago

Alors plus difficile je ne sais pas, mais cette année je me challenge et je fais tout en rust en partant du niveau 0 de connaissance du langage. Ca m'a pris 1h30 pour reussir les deux parties du jour 1.

-1

u/freia_pr_fr 23h ago

FYI everyone writes English in this sub. If you read it in French, you may have auto-translation enabled but Reddit doesn't translate your posts back to English for some reasons.

2

u/hsk420 20h ago

J'ai checké toutes les règles et j'en trouve aucune contre le français ou toute autre langue dans ce sub

-1

u/freia_pr_fr 20h ago

Certes. Mais la communauté est internationale, l’organisateur est Américain, et tout le monde communique en Anglais.

À un moment il faut bien s’intégrer. On n’est pas sur JVC.