https://kotlinlang.org logo
#advent-of-code
Title
# advent-of-code
d

David Whittaker

12/03/2019, 6:50 PM
This raises an interesting question: should we create a solution that solves our input or a solution that solves any input?
k

Kroppeb

12/03/2019, 7:00 PM
If your solution works for your input it will probably work for similar inputs. Although a just did an older problem as testing and for part 2 I decided to leave the possibility that my code wouldn't give the right result. It was based on the fact that I assumed that my target node had at least 3 children as the case for 2 children would be way more difficult and still had a 50% success rate in case that my target had 2 children in which case I could swap children in case of 2 and get the right result at the cost of 1 minute which would be shorter than actually coding the thing.
Which would have gotten me 63th place on the leaderboard and even higher if I noticed there where
,
in input in part 1
😲 1
So If you are going for implementation speed just go for quick and dirty.
t

todd.ginsberg

12/03/2019, 8:53 PM
I (try to) write solutions that will solve any input that the AoC author provides to participants. Meaning - if the instructions say we'll get two wires, I don't write code for three. Similar for null checking, etc. Anything specifically mentioned as an invariant in the problem description is fair game, anything not mentioned I ignore.
s

stkent

12/04/2019, 2:24 AM
And then a 2018day15 comes along and nobody's solution seems to work for every input 😰
💯 1
7 Views