AdventOfCode/Python/2021/06/day6.py

14 lines
258 B
Python
Raw Permalink Normal View History

2021-12-08 15:29:52 -08:00
with open("input.txt", 'r') as f:
data = f.readlines()
data = list(map(int, data[0].strip().split(",")))
fish = [data.count(i) for i in range(9)]
for i in range(256):
num = fish.pop(0)
fish[6] += num
fish.append(num)
print(sum(fish))