From 597840abc31ae9c7304a879b9da7f818aa0014d2 Mon Sep 17 00:00:00 2001 From: setop Date: Thu, 21 Sep 2023 02:02:17 +0200 Subject: [PATCH] clean day 6 --- d06/d06_2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d06/d06_2.py b/d06/d06_2.py index e194989..6751803 100644 --- a/d06/d06_2.py +++ b/d06/d06_2.py @@ -1,9 +1,9 @@ +import sys D ={ i:0 for i in range(9) } -for l in list(map(int,__import__("sys").stdin.read().split(","))): +for l in list(map(int,sys.stdin.read().split(","))): D[l]+=1 -for i in range(256): +for i in range(int(sys.argv[1])): # 80 then 256 D = { i-1:D[i] for i in range(9) } D[6] += D[-1] D[8] = D[-1] - del D[-1] -print(sum(D.values())) +print(sum(D[i] for i in range(9)))