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

I'm one of the people who solved problems very quickly (3rd overall last year). I'm somewhat competitive by nature, and I did ACM programming challenges in undergrad (although I was never good enough to make the local team, heh). Happy to answer any questions you might have about "competitive" AoC; it's fun in a very different way than learning new languages for the competition. I personally used Python for the last few years, and I'll probably use it again this year (assuming I try to compete).

Part of it is familiarity with the format, which of course assumes they keep things reasonably similar this year. Knowing the kinds of problems that appear (parsing, graphs, optimization, reverse engineering, etc.) helped me put together a little library of code that means I'm not spending time rewriting fundamental algorithms.

Reading problem statements is one of those skills I picked up from ACM programming competitions. The problem statements usually contain a lot of fluff - to speed-code you want to be able to pluck out the relevant bits quickly so you can start formulating the solution.

For day 3 in 2017, the spiral. Were you just aware of this concept before hand?

I’m not OP, but if I were solving this I’d just take the smallest square less than that number, figure out where it is (the top left or bottom right corner), and then “run” the algorithm from there, which should only require one “turn” at the most. You really don’t need to know anything about spirals in particular; just look for a pattern that you can take advantage of to reduce your work.

You make it sound so easy. Part 2 was the real gnarly bit.

Anyway I’m sure I won’t ever encounter that spiral as long as I live but if I do, I have code prepped for it :D

Oh, I didn't see that. The Advent of Code website is strangely annoying in that it makes it extremely difficult to find past problems…

Based on what I found online (which is abridged rewordings of the problem, something of a sequence sum?) I'd get lazy at that point and implement something that makes the spiral. Presumably, this shouldn't take to long, as the sequence grows rapidly so they can't give us a number that's too big…

>extremely difficult to find past problems…

Huh? Click [Events], click on the year, click on the day.

The second (and sometimes much harder) part of each days problem is only revealed when you complete the first part.

I was not particularly fast that day. If I recall correctly, I just bruteforced it (implemented the four-turn logic). Not elegant but it runs fast enough :)

Me too, good to know ;)

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