aoc2022/d11/part1.py

18 lines
378 B
Python
Raw Normal View History

2022-12-11 13:04:43 +00:00
import sys
mod = __import__(sys.argv[1])
M = mod.M
for r in range(20):
for k,m in enumerate(M):
items = m[0]
m[3] += len(items)
for _ in range(len(items)):
i = items.popleft()
ni = m[1](i) // 3
nm = m[2](ni)
M[nm][0].append(ni)
L=list(m[3] for m in M)
print(L)
LS=list(sorted(L))
print(LS[-1]*LS[-2])