advent2022/eleven.py

11 lines
263 B
Python
Raw Normal View History

2022-12-11 23:36:55 +02:00
#!/usr/bin/env python3
from useful import *
def monkey(p):
ls = p.strip().split('\n')
op = ls[2].strip().split()[4]
2022-12-11 23:40:38 +02:00
return [op, *[numbers(l) for l in ls[1:3]], *[numbers(l)[0] for l in ls[3:]]]
2022-12-11 23:36:55 +02:00
2022-12-11 23:40:38 +02:00
ms = [monkey(p) for p in pgphs(open(0).read())]
ic(ms)