News for hackers. Stuff that matters.
Re:Peter Norvig's “pytudes” for Advent of Code 2020 by Storm-Bringer on Friday January 08, 2021 @10:52AM (#25685869)
How do people usually tackle AdventOfCode? Most elegant/concise solution or best performant?

Asking because for example most solutions to Day 1 I've seen are O(n^2)

Re:Peter Norvig's “pytudes” for Advent of Code 2020 by Jtsummers on Friday January 08, 2021 @11:03AM (#25685997)
I aim for "first thing that I can get to work and doesn't take more than 20 seconds". Usually they run in under 2 (Common Lisp is my language of choice). Then for the part 2 portions I may have to optimize.

I sometimes go back and clean up my solutions, though I aim for a combination of clarity and performance if I do that, clarity first.

Re:Peter Norvig's “pytudes” for Advent of Code 2020 by travv0 on Friday January 08, 2021 @11:45AM (#25686541)
Unless I'm really unhappy with my solution, I stick with the first thing I write that spits out the correct answer. Since a lot of the problems require you to do some potentially interesting optimization to get an answer in a reasonable amount of time, I don't bother optimizing the ones that don't.