Advent of Code

It’s back. Not sure I’ll get to it anytime soon, though.

https://adventofcode.com/2020

Day 1 complete

I was curious how well I could do on day 2. I probably could have shaved off quite a few seconds. I tried my best to not worry about coding style, but so much is just reflexive. Dang, people are speedy.

image

Now it’s time for bed.

There’s a leaderboard join code up above in this thread 111686-e01a629f that a lot of us are already on.
I also made one for myself and invited my co-workers that you can feel free to join 143035-3eaa721f.

It’s not stupid if it works:

2 Likes

If I recorded and/or live streamed video of myself solving the advent of code, would that be interesting to watch or not? It has to at least be more interesting than watching me bike to nowhere, right?

That could be fun.

Now I want to livestream playing the train game… =P

If anyone wants to commit to playing trains in real time instead of async, I’m down. Plenty of free time over here.

Let’s do it. Pick a time during a weekend, we all get in a Discord together, and we play until the game ends while I stream it.

Let me figure out what day I’m hiking this weekend, and we can do the other day.

An esport where your score is combined Advent of Code and Zwift ranks.

1 Like

Despite how specific that is to me, there a lot of people who both code and bicycle. I’m sure I will not be the champion.

https://www.youtube.com/watch?v=Nrj0YQG9RNA

Sorry, I know the typing noises are annoying. I’ll work on it.

it’s the first year I’m doing this and it’s really fun so far ^^

using javascript/typescript with node, since that’s what I’m most comfortable with

Finished both parts of day 8 in about an hour. Feeling pretty good about that. I really like that sort of thing, effectively programming an emulator. AoC is nice in that I don’t have to worry about the parts I don’t like. A lot of the programming I do at work and home, input validation ends up taking a lot of my time and effort. Being able to completely trust the input file is so refreshing. I can completely concentrate on the processing part, and mostly ignore the I/O part. Just make a straight REPL.

1 Like

My day 9 solution was very ordinary. Just iterating and brute forcing the solution. I only added one very tiny performance enhancement. However, I’m still very proud that my code for both parts worked and produced a correct answer on the first try. Only took like 40 minutes.

I assume tomorrow the difficulty will increase. I sense a pattern of easy/hard/easy/hard.

Day 10 part 1 was easy.

Day 10 part 2 has me stumped, at least for now. I had some ideas. I felt I was close. I just couldn’t grasp the conclusion. Felt like I was jumping and barely touching an apple dangling from a tree.

Day 10 part two I’m at building the graph, and reducing the nodes from 99 down to 67 for my inputs, but checking all paths recursively from the start still takes forever
next up is splitting it into parts that all possibilities cross, getting their numbers, and then multiplying them together?

but there probably is a way easier comp sci method :sweat_smile:
but I’m treating it more as a puzzle challenge XD

Yep. I struggled a lot with part 2 yesterday. Although the problem definition suggests that there can be jumps of 1-3, if you look at your input you will noticed there are only jumps of 3 or 1. Nobody I spoke to had any 2s. This means you can make additional assumptions and get a cheating answer.

I got a cheating answer. It’s basically what you suggested about splitting into parts and multiplying them together. I actually had my hard-coded numbers for my cheating answer set incorrectly last night, and that’s why I temporarily gave up. I figured out this morning what I was wrong about and got the right answer. Here’s my code.

Then I looked up how other people did it by being clever. This is the solution I found that I like best. Less than ten lines, and easy to understand. 100% would hire this programmer off the street.

I just finished both parts of day 11. It wasn’t difficult, and it only took a little over an hour. That said, it took quite a bit more time and more lines of code relative to the difficulty of the problem. Thankfully I was able to parameterize my part 1 solution and reuse a lot of code for part 2.

yeah, just realizedthat every path has to go through the 3 jumps, so no complicated graph necessary

gonna try to make it work without looking at someone else’s code ^^