2020 day 12 + visualisation
This commit is contained in:
parent
29b64b4715
commit
171802a184
8 changed files with 1038 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
const fs = require('fs');
|
||||
const data = fs.readFileSync('input.txt', 'utf-8');
|
||||
const data = fs.readFileSync('./input.txt', 'utf-8');
|
||||
const lines = data.split('\n').map(num => parseInt(num)).sort((a,b)=>(a-b));
|
||||
lines.unshift(0); // add the outlet with joltage 0
|
||||
lines.push(lines[lines.length-1]+3); // your device has a joltage 3 above the highest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue