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)))