/aoc-ts

Advent of Code Solutions in Typescript

Primary LanguageTypeScript

Actions Status

aoc-ts

Advent of Code Solutions in Typescript

Usage

# run using ts-node
$ yarn solve-ts

# run using node
# build project before running
$ yarn build-ts
# run file
$ yarn solve

Options

-d, --day   Run solution for specific day
-p, --part  Run specific part of solution (defaults to 1)
-t, --time  Measure the time it takes to solve
--input     Provide a specific input file (defaults to ./inputs/{day}.txt)

Examples:

# Run 201801 part 1
$ yarn solve-ts -- -d 201801

# Run part 2 of 201901 with test.txt and output time taken
$ yarn solve-ts -- -d 201901 -p 2 -t --input="./inputs/test.txt"

Running Tests

# execute the tests
$ yarn test

Currently implemented solutions

2015 22/50 ⭐
Year Day Part 1 Run Time Part 2 Run Time
2015 1 ✔️ 395μs ✔️ 241μs
2015 2 ✔️ 3ms ✔️ 3ms
2015 3 ✔️ 6ms ✔️ 11ms
2015 4 ✔️ 807ms ✔️ 23s
2015 5 ✔️ 5ms ✔️ 11ms
2015 6 ✔️ 202ms ✔️ 203ms
2015 7 ✔️ 29ms ✔️ 57ms
2015 8 ✔️ 980μs ✔️ 824μs
2015 9 ✔️ 114ms ✔️ 119ms
2015 10 ✔️ 202ms ✔️ 4s
2015 11 ✔️ 106ms ✔️ 509ms
2018 6/50 ⭐
Year Day Part 1 Run Time Part 2 Run Time
2018 1 ✔️ 1ms ✔️ 19ms
2018 2 ✔️ 3ms ✔️ 16ms
2018 3 ✔️ 200ms ✔️ 215ms
2019 26/50 ⭐
Year Day Part 1 Run Time Part 2 Run Time
2019 1 ✔️ 200μs ✔️ 320μs
2019 2 ✔️ 700μs ✔️ 85ms
2019 3 ✔️ 150ms ✔️ 150ms
2019 4 ✔️ 90ms ✔️ 95ms
2019 5 ✔️ 2ms ✔️ 2ms
2019 6 ✔️ 2ms ✔️ 2ms
2019 7 ✔️ 60ms ✔️ 155ms
2019 8 ✔️ 3ms ✔️ 4ms
2019 9 ✔️ 2ms ✔️ 300ms
2019 10 ✔️ 35ms ✔️ 33ms
2019 11 ✔️ 25ms ✔️ 32ms
2019 12 ✔️ 7ms ✔️ 900ms
2019 13 ✔️ 37ms ✔️ 423ms
2020 50/50 🌟
Year Day Part 1 Run Time Part 2 Run Time
2020 1 ✔️ 280μs ✔️ 340μs
2020 2 ✔️ 3ms ✔️ 2ms
2020 3 ✔️ 550μs ✔️ 650μs
2020 4 ✔️ 4ms ✔️ 6ms
2020 5 ✔️ 4ms ✔️ 4ms
2020 6 ✔️ 4ms ✔️ 4ms
2020 6 ✔️ 88ms ✔️ 87ms
2020 7 ✔️ 1ms ✔️ 5ms
2020 8 ✔️ 6ms ✔️ 13ms
2020 9 ✔️ 650μs ✔️ 500μs
2020 10 ✔️ 3ms ✔️ 2ms
2020 11 ✔️ 810ms ✔️ 1s
2020 12 ✔️ 4ms ✔️ 5ms
2020 13 ✔️ 266μs ✔️ 491μs
2020 14 ✔️ 8ms ✔️ 280ms
2020 15 ✔️ 350μs ✔️ 4s
2020 16 ✔️ 3ms ✔️ 6ms
2020 17 ✔️ 60ms ✔️ 1s
2020 18 ✔️ 10ms ✔️ 12ms
2020 19 ✔️ 25ms ✔️ 330ms
2020 20 ✔️ 145ms ✔️ 240ms
2020 21 ✔️ 15ms ✔️ 3ms
2020 22 ✔️ 3ms ✔️ 1s
2020 23 ✔️ 262μs ✔️ 4s
2020 24 ✔️ 14ms ✔️ 1m
2020 25 ✔️ 141ms 🎅 N/A
2021 30/50 ⭐
Year Day Part 1 Run Time Part 2 Run Time
2021 1 ✔️ 900μs ✔️ 1ms
2021 2 ✔️ 2ms ✔️ 3ms
2021 3 ✔️ 2ms ✔️ 1ms
2021 4 ✔️ 18ms ✔️ 36ms
2021 5 ✔️ 64ms ✔️ 90ms
2021 6 ✔️ 720μs ✔️ 3ms
2021 7 ✔️ 3ms ✔️ 88ms
2021 8 ✔️ 1ms ✔️ 22ms
2021 9 ✔️ 2ms ✔️ 11ms
2021 10 ✔️ 2ms ✔️ 2ms
2021 11 ✔️ 8ms ✔️ 13ms
2021 12 ✔️ 32ms ✔️ 265ms
2021 13 ✔️ 13ms ✔️ 15ms
2021 14 ✔️ 15ms ✔️ 50ms
2021 15 ✔️ 51ms ✔️ 480ms
2022 12/50 ⭐
Year Day Part 1 Run Time Part 2 Run Time
2022 1 ✔️ 1ms ✔️ 1ms
2022 2 ✔️ 2ms ✔️ 5ms
2022 3 ✔️ 6ms ✔️ 6ms
2022 4 ✔️ 2ms ✔️ 1ms
2022 5 ✔️ 2ms ✔️ 2ms
2022 6 ✔️ 379μs ✔️ 3ms
2023 32/50 ⭐
Year Day Part 1 Run Time Part 2 Run Time
2023 1 ✔️ 2ms ✔️ 6ms
2023 2 ✔️ 2ms ✔️ 2ms
2023 3 ✔️ 16ms ✔️ 17ms
2023 4 ✔️ 4ms ✔️ 5ms
2023 5 ✔️ 2ms ✔️ 3h
2023 6 ✔️ 434μs ✔️ 408μs
2023 7 ✔️ 7ms ✔️ 6ms
2023 8 ✔️ 6ms ✔️ 16ms
2023 9 ✔️ 3ms ✔️ 4ms
2023 10 ✔️ 13ms ✔️ 23ms
2023 11 ✔️ 37ms ✔️ 37ms
2023 12 ✔️ 22ms ✔️ 864ms
2023 13 ✔️ 3ms ✔️ 44ms
2023 14 ✔️ 12ms ✔️ 2s
2023 15 ✔️ 3ms ✔️ 6ms
2023 15 ✔️ 16ms ✔️ 1s