function part1(input) {
let values = input.map((d) => {
let half1 = d.slice(0, d.length / 2);
let half2 = new Set(d.slice(d.length / 2));
for (let l of half1) {
if (half2.has(l)) return letterValue(l);
}
return { half1, half2 };
throw new Error("no dupe found");
});
return d3.sum(values);
}