This commit is contained in:
@@ -6,8 +6,7 @@ def part_1(input):
|
|||||||
numbers = [int(n) for n in input[0].split(',')]
|
numbers = [int(n) for n in input[0].split(',')]
|
||||||
count = [len([x for x in numbers if x == i]) for i in range(9)]
|
count = [len([x for x in numbers if x == i]) for i in range(9)]
|
||||||
for _ in range(80):
|
for _ in range(80):
|
||||||
tmp = count[0]
|
tmp = count.pop(0)
|
||||||
count = [count[i+1] for i in range(8)]
|
|
||||||
count[6] += tmp
|
count[6] += tmp
|
||||||
count.append(tmp)
|
count.append(tmp)
|
||||||
result = sum(count)
|
result = sum(count)
|
||||||
@@ -18,8 +17,7 @@ def part_2(input):
|
|||||||
numbers = [int(n) for n in input[0].split(',')]
|
numbers = [int(n) for n in input[0].split(',')]
|
||||||
count = [len([x for x in numbers if x == i]) for i in range(9)]
|
count = [len([x for x in numbers if x == i]) for i in range(9)]
|
||||||
for _ in range(256):
|
for _ in range(256):
|
||||||
tmp = count[0]
|
tmp = count.pop(0)
|
||||||
count = [count[i+1] for i in range(8)]
|
|
||||||
count[6] += tmp
|
count[6] += tmp
|
||||||
count.append(tmp)
|
count.append(tmp)
|
||||||
result = sum(count)
|
result = sum(count)
|
||||||
|
|||||||
Reference in New Issue
Block a user