Posts

Advent of Code Days 7 to 11

Dec 12, 2020 | 3 minutes to read

Tags: geeky, software

Wow! These challenges got hard in a hurry. I haven’t had as much time to focus on these this last week as well, so that was part of my problem too. The last day I’ve completed both parts on my own was day 6, so here’s a quick re-cap of 7 through 11. (I’m working on Day 12 now)

Day 7

A recursion problem, having you find which types of bags could be stored within other bags. I got Part 1 OK, surprisingly, since recursion usually throws me. They had us going up in the hierarchy, finding which bags might contain our gold bag. It took a while, but I got it done. But Part 2 was crazy. They had us finding how many bags a gold bag might contain and the recusion depth just confounded me. I have a sort of working script here but apparently I’m doing something wrong. I might try to come back to this one.

Day 8

You get to map out a little assembly-like program, with accumulator, jump and ‘nop’ instructions. Again, I got Part 1 done with the usual amount of struggle, but Part 2… I just don’t get it. They want us to figure out which one instruction out of like 900 we could change to remove the infinite loop (we found in Part 1). I worked on this over and hour and didn’t come close to answering it.

Day 9

I thought Part 1 was really straightforard, and I wrote the code pretty quickly. But I only got the star for the first half. In Part 2, you had to find the two or more numbers that sum up to the number you found in Part 1. I worked and worked on this but came up empty. It sounds easy but I just didn’t get there. I cheated a little and looked online at how others solved this and they used terms I didn’t understand. I’ll have to do some studying up to get this done, someday.

Day 10

This was about connecting adapters to a power charger, and working out their “joltages”. Part 1 was OK, again, just doing some basic math against the sorted list of inputs. But Part 2… nope. I didn’t have a clue how to even logically think through finding a solution. I again looked at Reddit, and saw people talking about ‘memoization’ and knew I was outta my league. I grabbed someone else’s python code and tried it against my inputs and, well, I see the right result but I don’t really understand it.

Day 11

This one seems OK. They have us manipulating a map of people sitting in seats, in rows and columns. Their iterated over their small example three times and then it settled to a point where nobody moves, following their 3 rules. As always, they give us a much larger set of data to work with though, so this is a challenge. I think I’m close but I have to learn a bit more about dictionaries in Python (I think, at least) to be able to map out the potential seat values over each iteration. Working on this Part 1 for this still, IOW.

No code for this post. I think there’s tons of other people’s samples out there for any interested.

Cheers,


You can leave a comment on this post here.