Day 24, part 2
This commit is contained in:
19
src/bin/d24p2.rs
Normal file
19
src/bin/d24p2.rs
Normal file
@ -0,0 +1,19 @@
|
||||
use aoc22::{
|
||||
day24::{self},
|
||||
util,
|
||||
};
|
||||
|
||||
pub fn main() {
|
||||
let (map, start, target) = day24::parse_map(&util::parse_input());
|
||||
|
||||
day24::print_map(&map, &start);
|
||||
|
||||
let (rounds_1, map_1) = day24::find_path(&map, &start, &target);
|
||||
println!("Goal is reachable in {} min", rounds_1);
|
||||
let (rounds_2, map_2) = day24::find_path(&map_1, &target, &start);
|
||||
println!("Start is reachable in {} min", rounds_2);
|
||||
let (rounds_3, _) = day24::find_path(&map_2, &start, &target);
|
||||
println!("Goal is reachable in {} min", rounds_2);
|
||||
|
||||
println!("Total time taken is {} min", rounds_1 + rounds_2 + rounds_3);
|
||||
}
|
||||
Reference in New Issue
Block a user