Public
Edited
Dec 22, 2022
Insert cell
Insert cell
Insert cell
itemInCommon = input.split("\n")
.map(d=> {let arr = [...d]; return d3.map(d3.intersection(arr.splice(0, Math.floor(d.length/2)), arr),x=> ids.get(x)[0]);} )

Insert cell
resultB = input.split("\n").map([0,1,2], d=>
Insert cell
resulta = d3.sum(itemInCommon, d=> d[0])
Insert cell
ids=d3.index(d3.range(26).map(i => [i+1,String.fromCharCode(97 + i)])
.concat(
d3.range(26).map(i => [i+27,String.fromCharCode(65 + i)])), d=> d[1])

Insert cell
Insert cell
d3 = require("d3-array@^2.8.0")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more