Public
Edited
Dec 12, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
AOC.resultTable(meta)
Insert cell
part1 = (s) => s.length
Insert cell
Insert cell
part2 = (s) => s.length
Insert cell
data = parse(which === "test1" ? test1 : input)
Insert cell
parse = (s) => {
const records = [];
for (const line of s.split("\n")) {
const [springs, grps] = line.split(/\s+/);
records.push({ springs: springs, lengths: grps.split(",").map(Number) });
}
return records;
}
Insert cell
Insert cell
Insert cell
Insert cell
inputs = ({
test: test1,
real: input
})
Insert cell
meta = AOC.meta({
day: 12,
year: 23,
title: "Hot Springs",
parse,
inputs,
parts: [part1, part2],
expected: { test: [10, 525152], real: [7922, 18093821750095] },
href: "https://observablehq.com/@a1ip/aoc-2023-day-12"
})
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