about summary refs log tree commit diff
path: root/aoc/2021/06/part-one.py
blob: f1ad2fb613eb1d8b0acaafec6aa20dc53e4d236a (plain) (blame)
1
2
3
4
5
6
7
8
9
from collections import deque
from sys import stdin

timer = deque([0] * 9)
for i in map(int, stdin.read().strip().split(',')): timer[i] += 1
for i in range(80):
    timer.rotate(-1)
    timer[6] += timer[-1]
print(sum(timer))