AoC 2022

From edition to edition I’m less ashamed to show my code, even if I’ve failed to solve a challenge. Or if my solution was pretty stupid. And I believe it’s good, as it helps me to learn and there’s nothing shameful in trying your best.

I’ve also improved my Vim skills as I was mainly coding on my iPad connected to my server via SSH. It was a challenge at first, but now I kind of like it. I’ve never really used visual selection, but now was forced to and quite enjoyed it. I’ve also learnt that if you don’t have escape key you can press Ctrl+[ instead. Now, about the challenges.

Day 9: Rope Bridge has given me a headache and I was running around it like crazy. I’m more than a bit ashamed it took me so long to solve first part. And then to figure out the second. It’s so obvious in retrospect, but probably everything is.

Day 11: Monkey in the Middle was fun to solve for first part, but I hate the second one. It’s one of these “be clever” challenges where it matters most that you know this math trick. Well, I didn’t know it, so I didn’t like it. It looks it was pretty obvious to my CS educated pals, so I’m probably not educated enough. But seriously, I’ve lost sleep because of this. It’s became an obsession:( In the end I’ve sneak peeked it from someone else’s solution. And I admit, I would’ve never thought about it.

There was also pretty embarrassing mistake in my implementation of getting two largest numbers if you’ll check the commits. One of this mistakes which aren’t apparent because they sometimes work as expected. And I’ve actually solved it properly if you’ll check the history, but then decided I would be smart and make this function reentrant for part 2. Which I’ve never used, but the mistake stayed. Let it be the lesson for you kids. Pay attention and don’t try to outsmart yourself.

Day 12: Hill Climbing Algorithm was one of this “I know how to solve it (at least first part), but I don’t want to code all of this” challenges. Or maybe I’m just saying it, and can’t really solve it;)

Day 13: Distress Signal was a flashback from the last year. There was also a challenge with packets and I‘ve also skipped it because it’s felt like more job around parsing than actual logic. Hate such challenges.

Day 15: Beacon Exclusion Zone was really interesting. After brute forcing it for small sample I’ve thought I won’t solve it for proper input. But then I had an idea and was able to proceed. No luck with second part however. I need to read about it, because there was similar challenge last year and I’ve also not completed it, shame on me.

Day 16: Proboscidea Volcanium was nice, although I’ve failed to solve even the first part. I’ve finally got a chance to play with graphs, and I believe I now better understand how they work. Or not, as I’ve failed to solve the puzzle. But I’ve solved it for sample input. It’s something, right? Still, I don’t know where I’ve gone wrong, but maybe someday I’ll find out.

Day 17: Pyroclastic Flow was another “I would’ve probably solved it, but with my current state of knowledge it would’ve been too much work” type of challenge. However, it was quite interesting because who doesn’t like Tetris.

Day 19: Not Enough Minerals was interesting. Had some fun coding it. Haven’t solved it in the end, but learnt a bit about how such things can work and how by changing different parts I can influence the output. Maybe I’ll figure the solution out at some point, I like to get back to interesting challenges.

Day 20: Grove Positioning System was nice, I knew exactly what to do from the beginning. I’ve started coding. I knew that real input may contain duplicates, even if sample doesn’t, and I should handle it. But I’ve said to myself I can handle it later. And of course I forgot, so started running circles:( Finally it’s occurred to me where I was wrong, and I’ve solved both parts quite quickly. Lesson learnt, I hope.

Day 21: Monkey Math first part was fun, and went quite smooth. And then I’ve hit the wall. I can easily solve it mathematically, but I don’t know how to code it:(

Day 25: Full of Hot Air. Man, last day supposed to be a fun and light. But it wasn’t:( Converting from snafu was easy, but to snafu… I was lost. When I’ve almost given up I’ve checked other numerical systems on wikipedia and found Balanced ternary. Didn’t want to implement full math described there, so decided there must be an easier way, and found Balanced Ternary Number System which, after a modification, allowed me to complete the challenge. I’ve finished it on 30th instead of 25th, as my Christmas wasn’t so calm as I would want, but oh well.

My job is more similar to AoC than to “real” programming which is great, but it doesn’t mean I’m coding like that for work. Or at least I hope. I’m dealing with a lot of different file formats for which I need to create my own parsers/converters, or at least tweak existing ones. So, I really appreciate there’s such thing as AoC. Even though, if you look at numbers, I’m getting worse and worse at solving these puzzles.

AOC 2021 calendar