mirror of
https://github.com/tomru/adventofcode.git
synced 2026-03-03 06:27:19 +01:00
25 lines
404 B
JavaScript
25 lines
404 B
JavaScript
import * as readline from 'node:readline';
|
|
import * as fs from 'node:fs';
|
|
|
|
|
|
const data = [];
|
|
const rl = readline.createInterface({
|
|
input: fs.createReadStream('./input')
|
|
});
|
|
|
|
for await (const line of rl) {
|
|
data.push(parseInt(line, 10));
|
|
}
|
|
|
|
|
|
let last = null;
|
|
let part1 = 0;
|
|
|
|
for (const v in data) {
|
|
if (last !== null && v > last) counter++;
|
|
last = v;
|
|
}
|
|
|
|
console.log('part1', part1);
|
|
|