diff --git a/Day6/Part1.js b/Day6/Part1.js index 3a620a8..6cb6a0d 100644 --- a/Day6/Part1.js +++ b/Day6/Part1.js @@ -1,8 +1,16 @@ import { readFileSync } from "fs"; const t0 = performance.now(); -const input = readFileSync("input.txt").toString(); -console.log(input); +const input = readFileSync("input.txt").toString().split("\n"); +const time = input[0] + .split(/\s{1,}/) + .slice(1) + .map(Number); +const distance = input[1] + .split(/\s{1,}/) + .slice(1) + .map(Number); +console.log(time, distance); const t1 = performance.now(); console.log(`Runtime: ${t1 - t0}ms`);