Files
python-aoc-2021/day06/part2.py
Sebastian Seedorf 5529f62ab6 Day 06
2021-12-06 11:55:28 +01:00

12 lines
300 B
Python

#!/usr/bin/env python3
from collections import Counter
counter = Counter(map(int, [x for x in open("input.txt")][0].split(',')))
counter = [counter.get(idx, 0) for idx in range(0, 9)]
for day in range(256):
counter = counter[1:] + counter[:1]
counter[6] += counter[-1]
print(sum(counter))