This was my first year participating in Advent of Code. I haven't yet taken a DS/A course while completing my C.S. program, so a lot of these data structures and ideas were brand new concepts for me.
I've finished just over half of the twenty-five days, and plan to work through the rest of them at a leisurely pace, over the next several months.
I'm proud of several solutions I came to on my own, such as day 6. I quickly figured out to use a map of each day's fish and its respective count, rather than keeping track of every individual fish.
Here's my solution, in Python 3:
# 'data' read in from input file
fish = {n: data.count(n) for n in range(9)}
DAYS = 256
for _ in range(DAYS):
breed = fish[0]
for i in range(8):
fish[i] = fish[i + 1]
fish[i + 1] = 0
fish[6] += breed
fish[8] += breed
answer = sum(fish.values())
Top comments (0)