Public
Edited
Dec 25
Paused
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function parse(input) {
return input.split("\n\n").map((d) =>
parseInt(
d.replace(/[#.\n]/g, (c) => (c === "#" ? "1" : c === "." ? "0" : "")),
2
)
);
}
Insert cell
Insert cell
function part1(input) {
return AOC.pairwiseCombinations(parse(input)).filter(
(d) => (d[0] & d[1]) === 0
).length;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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