monkeys = data
.trim()
.split("\n\n")
.map((p, i, all) => {
const starting = p.match(/Starting items: (.*)/)[1];
const items = starting.split(", ").map(Number);
const inspect = eval(`(old) => ${p.match(/Operation: new = (.*)/)[1]}`);
const test = +p.match(/Test: divisible by (\d+)/)[1];
const throws = {
true: +p.match(/If true: throw to monkey (\d+)/)[1],
false: +p.match(/If false: throw to monkey (\d+)/)[1]
};
return { items, inspect, test, throws, inspects: 0, targets: new Array(all.length).fill(0) };
})