Hacker News new | past | comments | ask | show | jobs | submit login

I wonder how the persons on the leader board manages it? First person today solved part1 after 39 seoncds, and was done with part2 after 53 seconds!

I felt I was quite fast in being done with part1 after 3 minutes and part2 in 4 minutes (rank ~1000). I even tried to skimread the explanation to be fast, have a script to download the input and run it etc., but still no match!




1. Have everything in place at the start (a script to grab the inputs helps).

2. Use a language that makes the edit/run cycle short.

3. Be very familiar with that language and how to process input in it.

4. Have solved many similar problems in the past so you can parse these problem statements quickly.

5. Have solved many similar problems in the past so you know exactly what code to write or use (if you have a utility library).


> 1. Have everything in place at the start (a script to grab the inputs helps).

Definitely. A lot of it is always the same (open files, iterate over input, operating on arrays/lists etc.). Something like Peter Norvig has in Python:

https://github.com/norvig/pytudes/blob/main/ipynb/Advent%20o...


“Have solved many similar problems in the past so you can parse these problem statements quickly”

This sounds like an advent of code specific thing. The problem itself is trivial, no need to have solved anything similar in the past, but the description is so verbose (because it’s a cute Santa-related story) that it becomes hard to parse the problem we’re trying to solve, quickly.

I don’t think this is common in any other competitive programming environment.


Feel I have to disagree on this one. Firstly, most programming competitions I've been to have this kind of problem description as well, just check Kattis problems for instance.

But secondly, while the problems in the beginning are trivial, you still have a huge advantage if you can immediately start programming without having to think, or having to look up a function in the stdlib. (Spoilers:) I probably wasted a minute today thinking about the solution of making a list for elves, and creating a new element whenever I saw an empty line. While a pro probably immediately did a split on "\n\n", summed and was done.


ehm

I did s.split("\n\n").fold... But this was first thing in the morning and where I lost time was that what I actually did at first was: s.split("/n/n")


Google FooBar uses this exact form as well, state the problem as a somewhat consistent story through the different challenges.


You only need to read the bolded white words to have a very educated guess (5 second skim; it's intentional)


It helps if you sort of read the problem statement backwards


I have most of it in place, but I guess it's 4&5 I need to improve. I feel like my problem, when comparing to the video posted of today's winner, is that I'm "too safe". I should gamble a bit more, read only parts of it at the chance of misunderstanding, and go with my first thought of implementation even though it may not work. Because the moment I start to consider things the others are already done, heh.

And I guess I could do better on 2, but on this day I only needed 1 run. I use Kotlin, and guess I lose a second or two on it compiling before running. I see today's winner just did everything in browser console as a repl. So that's probably a good way to minimize the loop. Pretty annoying for the later problems, though.


Where can I find that video of the winner?


How do you grab the inputs? I get the following error:

     curl https://adventofcode.com/2022/day/1/input   
    Puzzle inputs differ by user.  Please log in to get your puzzle input.


There's a session token in your browser cookie for the site, you have to pass that to the server. Honestly, though, I'm not going to be in the top 100 so I don't bother anymore. I open the input and hit Cmd-s and save it to my inputs directory. I've made it into the top 100 precisely one time in the 4 years (this is my 5th) I've participated, and I honestly don't know why I was in the top that time. It wasn't a terribly hard problem (for the folks that were reliably making it in the top 100) if you'd done the earlier parts since it was a simple search (increment register 0 value, check that it's not in a cycle, and count the number of executed instruction if it halts). You did need to complete day 16 first though, and it was closer to Christmas itself so maybe that was why.

If you do use a download script make sure you check whether or not you've downloaded it before. He's also requested that you put in a user agent that provides some contact info (rather than being generic). The server has been getting slammed by people hitting it too often and he's considering banning some, and wants a way to reach out to people who may have a misbehaving script.

https://adventofcode.com/2018/day/21 - My one top 100 result

https://adventofcode.com/2018/day/16

https://www.reddit.com/r/adventofcode/comments/z9dhtd/please...


A comment further down this thread reveals it: https://news.ycombinator.com/item?id=33813169


Here is exactly what you wanted!

https://www.youtube.com/watch?v=Vl1w7kWRtDg


Do you want to be fast, or do you just want to have fun?

Who cares what others do with the game? Have fun while doing it


For the easier tasks, my "fun" is doing it as quickly as possible first ;) Then I rewrite it with a goal in mind, for instance entirely functional with no mutations, as a single expression or whatever.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: