105
SOLUTION MEGATHREAD-🎄- 2022 Day 2 Solutions -🎄-(self.adventofcode)
submitted 3 years, 1 month ago* (edited 4 days, 4 hours after) by daggerdragon to /r/adventofcode (134.8k)
NEW AND NOTEWORTHY
- All of our rules, FAQs, resources, etc. are in our [community wiki](/r/adve...
since 3 years, 1 month ago
7 of 7
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


Go/Golang
Not really happy with the hardcoding, but oh well...
Thanks! Hopefully I'll actually finish this year; never did get around to completing 2021... are you working on the puzzles too? I'd love to see your repo.
To be fair, my initial solutions usually aren't very concise either. I definitely go back all the time to clean up, simplify, or straight-up refactor. All part of the process.
Good luck with the future puzzles, we got this!
Why? That's not how I did it, but for 9 possible inputs and easy calculations this is good style imho.
Yeah... after thinking about it for a bit and looking at some of the other solutions, it definitely seems to be the simplest thing that works.
I had a nagging feeling that there must be some clever/concise way of solving it with math, but that'd probably end up being more code and not really any clearer.