From 28d6c497dbb75a51419e107fc8a2e5af1656193f Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Mon, 10 Apr 2023 18:01:24 +0200 Subject: Day9 done in rust --- 2022/Rust/src/day8.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to '2022/Rust/src/day8.rs') diff --git a/2022/Rust/src/day8.rs b/2022/Rust/src/day8.rs index 6a337f6..3af5d26 100644 --- a/2022/Rust/src/day8.rs +++ b/2022/Rust/src/day8.rs @@ -18,7 +18,6 @@ impl Direction { } fn is_visible(grd: &Vec<&str>, direction: &Direction, visible: &mut Vec>) { - let mut max_height = 0; match direction { Direction::Up => { for j in 0..grd[0].len() { @@ -109,16 +108,13 @@ fn count_vis_up(pos: (usize, usize), grd: &Vec<&str>) -> usize { let mut cnt = 0; if is_valid_idx(pos, (grd.len(), grd[0].len()), &Direction::Up) { let ch = grd[pos.0].chars().nth(pos.1).unwrap() as u8; - // print!("{:?} ", pos); for i in (0..=(pos.0 - 1)).rev() { - // print!("{:?}, ", (i, pos.1)); if grd[i].chars().nth(pos.1).unwrap() as u8 >= ch { cnt += 1; break; } cnt += 1 } - // println!() } cnt } -- cgit v1.2.3