day 10, easy with itertools.groupby
part 2 scales thanks to codon
This commit is contained in:
parent
199bc88505
commit
df55eec6d8
|
@ -0,0 +1,7 @@
|
||||||
|
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))
|
Loading…
Reference in New Issue