Day | Technique |
---|---|
1 (Part 1) | Remember value in variable |
1 (Part 2) | Remember value in variable |
2 (Part 1) | Abstract logic flows |
2 (Part 2) | Abstract logic flows |
3 (Part 1) | Using maps |
3 (Part 2) | Using maps |
4 (Part 1) | Check if complete subset |
4 (Part 2) | Check if intersect |
5 (Part 1) | Manipulating arrays like a stack (push, pop) |
5 (Part 2) | Manipulating arrays (splice, concat) |
6 (Part 1) | Sliding window |
6 (Part 2) | Sliding window |
Inputs can be created as text files to be piped as stdin
.
# Install dependencies
npm i
# Pipe input to stdin
node day1 < day1\input.txt
# To pipe output to a file (note that the out.txt will be created in current directory)
node day1 < day1\in.txt > out.txt