boxes = {
const boxes = new Array(256).fill(0).map(() => []);
for (const code of input.split(",")) {
const [, label, op, focal] = code.match(/(\w+)([-=])(\d*)/);
const box = HASH(label);
if (op === "-") {
const i = boxes[box].findIndex((d) => d.label === label);
if (i > -1) boxes[box].splice(i, 1);
} else {
const i = boxes[box].findIndex((d) => d.label === label);
if (i > -1) boxes[box].splice(i, 1, { label, focal });
else boxes[box].push({ label, focal });
}
}
return boxes;
}