Public
Edited
Dec 2, 2024
Paused
25 forks
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function parse(input) {
return input.split("\n\n").map((block) => block.split("\n").map(Number));
}
Insert cell
Insert cell
function part1(input) {
const elfCalories = parse(input);
return Math.max(...elfCalories.map(AOC.sum));
}
Insert cell
Insert cell
Insert cell
Insert cell
function part2(input) {
const elfCalories = parse(input);
return AOC.sum(AOC.sort(elfCalories.map(AOC.sum)).slice(-3));
}
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