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.
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.
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.
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).
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)
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.
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().
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.
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)
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 😮💨
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.
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.
20
u/milan-pilan 13h ago edited 13h 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.
7
u/dl__ 8h 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.
12
u/hrabrica 12h 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.
2
u/akira_88 10h 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)
1
u/pikzel 12h ago
I did it in Go, slightly more coding than usual Day 1’s, but would have been a oneliner in other languages.
1
u/Cold_Comparison6184 6h 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.