AoC-23/Day17/Part1.js

21 lines
470 B
JavaScript
Raw Normal View History

2024-01-27 21:17:08 +00:00
import { readFileSync } from "fs";
const t0 = performance.now();
const input = readFileSync("input.txt")
2024-01-27 21:17:21 +00:00
.toString()
.split(/\r*\n/)
.filter((e) => e.length > 0)
.map((a, j) => a
.split("")
.map((b, i) => ({
c: +b,
x: i,
y: j,
d: 0,
h: 0
})));
console.log(input[0].slice(-1)[0]);
2024-01-27 21:17:08 +00:00
const t1 = performance.now();
console.log(`Runtime: ${t1 - t0}ms`);