mirror of
https://github.com/Baipyrus/AoC-23.git
synced 2024-12-27 04:21:45 +00:00
d6p1 - read and parse input
This commit is contained in:
parent
bb3d362aba
commit
a70260cb8a
@ -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`);
|
||||
|
Loading…
Reference in New Issue
Block a user