nieuw jaar

This commit is contained in:
2022-12-03 15:48:04 +01:00
parent 066cf2a37a
commit e7c428b678
14 changed files with 2754 additions and 249 deletions

17
src/2022/day1/index.ts Normal file
View File

@@ -0,0 +1,17 @@
import * as fs from 'fs';
import path from 'path';
import {readFile} from "../../utils";
let input = readFile(path.resolve(__dirname, 'input.txt'));
const ans = Math.max(
...input
.split("\n\n")
.map(a => a.split("\n"))
.map(buck => buck
.map(Number)
.reduce((a, b) => a + b), 0)
)
console.log(ans);