diff --git a/day06/part1.py b/day06/part1.py index f5a26f8..3b6e1b3 100644 --- a/day06/part1.py +++ b/day06/part1.py @@ -5,7 +5,6 @@ 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(80): - counter = counter[1:] + counter[:1] - counter[6] += counter[-1] + counter[(day+7) % 9] += counter[day % 9] print(sum(counter)) diff --git a/day06/part2.py b/day06/part2.py index c63ebe9..eab6a06 100644 --- a/day06/part2.py +++ b/day06/part2.py @@ -5,7 +5,6 @@ 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] + counter[(day+7) % 9] += counter[day % 9] print(sum(counter))