My solutions to Advent of Code 2022. This year, I'm going to try doing the challenges in completly in Rust
git clone [email protected]:edmBernard/AoC-2022.git
cd AoC-2022
cargo build --release
cargo run -- data
Run each part and expect result to be from my input
cargo test
The executable is named AoC-2022
. Inputs path can be specified as argument or by default in the data folder.
Day | Description | Tips |
---|---|---|
Day01 puzzle solution | Max of range | - |
Day02 puzzle solution | Rock Paper Scissors | - |
Day03 puzzle solution | Duplicate in compartments | - |
Day04 puzzle solution | Check range overlapping | - |
Day05 puzzle solution | Stack swap | - |
Day06 puzzle solution | Check block if duplicate | - |
Day07 puzzle solution | Directory mapping | - |
Day08 puzzle solution | Line of sight | - |
Day09 puzzle solution | Move rope | Using a big vec instead of HashSet |
Day10 puzzle solution | cycle synchronisation in CRT | part2 is a visual solution |
Day11 puzzle solution | Monkey pass | part2 overflow so we use Least common multiple-like to reduce worry level at each pass |
Day12 puzzle solution | Search path algorithm (BFS or Dijkstra) | Start from the End and different stop condition for part1 and part2 |
Day14 puzzle solution | Sandfall | - |
Day15 puzzle solution | Blind spot in Sensor Area | Check only points in frontier of the detected area |
Day16 puzzle solution | Graph search with valve | Floyd-Warshall and memoization |
In Rust
days::day01::day01_speed in 67.84 us : part1=70720 part2=207148
days::day02::day02_speed in 81.44 us : part1=11475 part2=16862
days::day03::day03_speed in 73.59 us : part1=8202 part2=2864
days::day04::day04_speed in 62.08 us : part1=490 part2=921
days::day05::day05_speed in 86.36 us : part1=ZWHVFWQWW part2=HZFZCCWWV
days::day06::day06_speed in 52.09 us : part1=1282 part2=3513
days::day07::day07 in 276.58 us : part1=1543140 part2=1117448
days::day08::day08_speed in 257.59 us : part1=1688 part2=410400
days::day09::day09_speed in 383.57 us : part1=6503 part2=2724
days::day10::day10 in 43.77 us : part1=11720 part2=2
days::day11::day11_speed in 1999.36 us : part1=117624 part2=16792940265
days::day12::day12_speed in 1567.76 us : part1=437 part2=430
days::day14::day14 in 3489.00 us : part1=1003 part2=25771
days::day15::day15_speed in 14748.00 us : part1=5525990 part2=11756174628223
days::day16::day16 in 3734649.00 us : part1=1754 part2=2474
In C++
day01_speed_iter in 66.7159 us : part1=70720 part2=207148
day02 in 67.3343 us : part1=11475 part2=16862
day03 in 55.5822 us : part1=8202 part2=2864
day04 in 72.6224 us : part1=490 part2=921
day05 in 78.4286 us : part1=ZWHVFWQWW part2=HZFZCCWWV