18 lines
356 B
TypeScript
18 lines
356 B
TypeScript
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);
|
|
|