Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
330 B · 9 lines
TypeScript
at rust
12345678910#!/usr/bin/env -S deno run --allow-read
import { cons, sum } from "../../lib/functions.ts";
const nums = Deno.readTextFileSync("input").trim().split("\n").map(Number);console.log([...cons(nums, 2)].filter(([a, b]) => a < b).length);console.log( [...cons([...cons(nums, 3)].map(sum), 2)].filter(([a, b]) => a < b).length,);