Skip to content

Code solutions for Advent of Code challenges (2022 edition), with detailed challenge descriptions and step-by-step solution details, including code snippets and tests.

Notifications You must be signed in to change notification settings

kaiosilveira/advent-of-code-2022

Repository files navigation

Continuous Integration Continuous Integration - NodeJS

Advent of Code 2022

This repo contains code solutions for the Advent of Code challenges, with detailed challenge descriptions and step-by-step solution details, including code snippets and tests.

Programming language choice

Most part of the solutions are implemented using Rust, as it's the language I'm currently studying. Rust is a language created to be fast while also providing a safe runtime. These premises are accomplished by providing a strong compile-time analysis together with a strong type system and some low-level details. Its built-in package manager and build tool, Cargo, provides all the basic tooling needed to easily get the ball rolling.

Some solutions are implemented using Javascript as a fallback for times when I didn't manage to get a solution working with Rust. These JS solutions will be ported to Rust whenever I have some time.

Repository structure

This monorepo is structured to hold all the code for all days of the advent of code. Each directory starting with day- is a cargo-generated Rust project containing all the details about the challenge for that day and also all the code implemented to solve it. The file tree looks like this:

├── README.md
├── day-01
│   ├── Cargo.lock
│   ├── Cargo.toml
│   ├── README.md
│   ├── input.txt
│   ├── sample.txt
│   └── src
│       ├── lib.rs
│       └── main.rs
.
. ... day 02 to day n-1
.
└── day-n
    ├── Cargo.lock
    ├── Cargo.toml
    ├── README.md
    ├── input.txt
    ├── sample.txt
    └── src
        ├── lib.rs
        └── main.rs

Each day-n project look similar, containing:

  • Cargo related config files
  • a README.md with the challenge URL, description and collapsable solution blocks (with "See solution" as its title)
  • a sample.txt file, containing the example described in the challenge
  • a input.txt file, containing the actual input provided by the challenge
  • a src/lib.rs file, containing the actual implementation and tests
  • a src/main.rs file, containing the code that loads the input data, parses it and calls the implementation

Solutions

The table below contains the solutions for all challenges solved so far.

day title implementation part I part II
#1 Calorie counting here
#2 Rock, paper, scissors here
#3 Rucksack Reorganization here
#4 Camp Cleanup here
#5 Supply Stacks here 🚧 🚧
#6 Tuning Trouble here 🚧 🚧
#7 No Space Left On Device here 🚧 🚧
#8 Treetop Tree House here 🚧 🚧
#9 Rope Bridge here 🚧 🚧
#10 Cathode-Ray Tube here 🚧 🚧
#11 Monkey in the Middle here 🚧 🚧
#12 Hill Climbing Algorithm here 🚧 🚧
#13 Distress Signal here 🚧 🚧
#14 Regolith Reservoir here 🚧 🚧
#15 Beacon Exclusion Zone here 🚧
#16 Proboscidea Volcanium here
#17 Pyroclastic Flow here
#18 Boiling Boulders here 🚧
#19 Not Enough Minerals here
#20 Grove Positioning System here
#21 Monkey Math here
#22 Monkey Map here
#23 Unstable Diffusion here
#24 Blizzard Basin here
#25 Full of Hot Air here
  • ✅ = solved and documented
  • 🚧 = solved, but without documentation
  • ❌ = Not solved yet

About

Code solutions for Advent of Code challenges (2022 edition), with detailed challenge descriptions and step-by-step solution details, including code snippets and tests.

Topics

Resources

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy