sensible monkey format

This commit is contained in:
DUEFON 2022-12-11 22:40:38 +01:00
parent 92f555437a
commit 05cb9345a1
1 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ from useful import *
def monkey(p):
ls = p.strip().split('\n')
op = ls[2].strip().split()[4]
return op, [numbers(l) for l in ls[1:]]
return [op, *[numbers(l) for l in ls[1:3]], *[numbers(l)[0] for l in ls[3:]]]
print(monkey(pgphs(open(0).read())[0]))
ms = [monkey(p) for p in pgphs(open(0).read())]
ic(ms)