Public
Edited
Dec 9, 2023
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
AOC.resultTable(meta)
Insert cell
Insert cell
part1 = (s) => AOC.sum(s.map(next))
Insert cell
Insert cell
part2 = (s) => AOC.sum(s.map((ns) => next(ns.reverse())))
Insert cell
data = parse(which === "test1" ? test1 : input)
Insert cell
parse = (s) =>
s
.trim()
.split("\n")
.map((l) => l.split(" ").map(Number))
Insert cell
Insert cell
Insert cell
inputs = ({
test: test1,
real: input
})
Insert cell
meta = AOC.meta({
day: 9,
year: 23,
title: "Mirage Maintenance",
parse,
inputs,
parts: [part1, part2],
expected: { test: [114, 2], real: [2005352194, 1077] },
href: "https://observablehq.com/@a1ip/aoc-2023-day-9"
})
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