4 ms·
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
by Storm-Bringer 6y ago
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)
- Jtsummers 6y agoI 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.
- travv0 6y agoUnless 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.