aoc2015/d10/run.py

7 lines
194 B
Python

import sys
from itertools import groupby as gb
r = sys.argv[1]
for _ in range(int(sys.argv[2])):
r = "".join(f'{n}{c}' for c,n in map(lambda x: (x[0],len(list(x[1]))), gb(r)))
print(len(r))