mirror of
https://github.com/mx42/aoc2024.rs.git
synced 2026-01-14 13:59:52 +01:00
chore: clippy + time
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
advent_of_code::solution!(10);
|
||||
|
||||
use std::iter::successors;
|
||||
|
||||
#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq)]
|
||||
struct Pos {
|
||||
x: usize,
|
||||
@@ -94,27 +92,6 @@ impl Topo {
|
||||
}
|
||||
}
|
||||
|
||||
fn print_route(route: Vec<(Pos, u8)>, max: &Pos) {
|
||||
println!("==========");
|
||||
for y in 0..max.y {
|
||||
print!("|");
|
||||
for x in 0..max.x {
|
||||
let mut found = false;
|
||||
for r in &route {
|
||||
if r.0.x == x && r.0.y == y {
|
||||
found = true;
|
||||
print!("{}", r.1);
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
print!(" ");
|
||||
}
|
||||
}
|
||||
println!("|");
|
||||
}
|
||||
println!("==========");
|
||||
}
|
||||
|
||||
pub fn part_one(input: &str) -> Option<usize> {
|
||||
let topo = Topo::init(input).ok()?;
|
||||
let ths = topo.get_trailheads();
|
||||
|
||||
Reference in New Issue
Block a user