# Tag: Advent of Code

Time for some final thoughts on Advent of Code 2020. This was my sixth Advent of Code but the first time I completed all 25 days. Better than last year's 31 and a whole lot better than my weakest effort of 11 stars in 2017. I managed to find the time to finish all but two on the day they were released and finished those two on Christmas morning.

# COMMENTS
Day 24 didn't take that much time so I had a chance to go back and finish day 21. As usual, all my code is up here. Day 21 Problem Link It took me a while to get my head around this example. You have a set of recipes. Each recipe has a list of ingredients and a list of allergens. Your job for part 1 was basically to determine which ingredients don't contain any allergens.

# COMMENTS
A few days have past so it's time for an update. Two more days to go and while I haven't completed all the problems, I have accumulated 43 stars which is a personal best. Given the nature of the problems I'm missing, I might even go back and do them at some point. Of course, I may very well also just crash out on the final two days. As usual, all my code is up here.

# COMMENTS
Day 17 Day 17 brought back Cellular Automata. It was a nice follow up to day 11. In my writeup I talked about data representation - how a Cellular Automoton like Conway's game of life is a nice 2D array project in a class like APCS-A but multi dimensional arrays are only one way to represent a cellular automaton. Day 17 really drove that home. The actual rules were pretty simple - if a cell is active and has 2 or 3 active neighbors it stays active.

# COMMENTS
Today's problem was a fun one to solve. Why was it fun? Stay tuned, The basic gist is that you have a plane ticket which is a set of numbers but you don't know which number maps to which category - row, seat, gate, etc. You also know the number ranges for each category. For example, row might be a number between 6 and 11 or 33 through 44 while a seat might be 13 through 40 or 45 through 50.

# COMMENTS
Time for Day 14!!! I didn't write up day 12 but here's a Clojure video runthrough. I also didn't write up day 13 mostly because I hacked together my part 2 in Python and still want to rewrite it in decent clojure. In any event, all my solutions are up on GitHub. Day 14 had a few interesting things going on. At its core it's a small machine simulator where you have to deal with binary numbers.

# COMMENTS
Today was Cellular Automaton Day at Advent of Code. You have a world that's usually represented as a grid of cells. Each cell can be in a certain state. Given a certain state, the next state is determined by simple rules like for a given cell how many of it's neighbors are the same color. The most popular Cellular Automat is probably Conway's Game of Life where each cell can be either alive or dead in a given generation and in the next generation the state will be determined by how many of its neighbors are currently dead or alive.

# COMMENTS
As we get closer to the end of the semester and time becomes scarcer I'm wondering how many more I'll finish. Barely had time to do days 9 and 10. Not much to say about day 9 Part one was basically a rehash of day 1 part 1 but with a sliding widow. Part 2? I just brute force tried all the subranges. I meant to go back to try to improve the solution but didn't have a chance.

# COMMENTS
Today we'll talk about days seven and eight. Let's start with 7. I teach all morning on Mondays. I woke up and worked out and then took a look at the problem in the few minutes before class. It was certainly harder than days one through six but I felt it was something I knew I could do based on past experience so I quickly started to throw something together.

# COMMENTS
Day 6 turned out to be pretty straightforward. Like day 4 you had to deal with two consecutive newlines when parsing the data but assuming you did day 4 that's no problem. The gist is that a group is formed by consecutive lines and groups are separated by a blank line. Each line in each group is a string of letters representing answers to questions. For instance, for this group: abc abd ab you have three people.

# COMMENTS