aoc-2021/6/6.py
Jack Bond-Preston 8d22f83bf5 day 6
Signed-off-by: Jack Bond-Preston <jackbondpreston@outlook.com>
2021-12-12 02:41:47 +00:00

19 lines
351 B
Python

day_fish = [0] * 9
with open("input.txt") as f:
contents = f.read()
for fish in contents.split(","):
fish = int(fish)
day_fish[fish] += 1
print(day_fish)
days = 256
for i in range(0, days):
zeros = day_fish[0]
day_fish = day_fish[1:] + [0]
day_fish[6] += zeros
day_fish[8] += zeros
print(sum(day_fish))