diff --git a/src/days/d8.rs b/src/days/d8.rs index 88a2d05..8335980 100644 --- a/src/days/d8.rs +++ b/src/days/d8.rs @@ -16,13 +16,12 @@ fn _parse (data: &str) -> I { let l = l.trim(); w = l.len(); for (i, c) in l.chars().enumerate() { + if c == '.' { continue; } m.entry(c).or_default().push((h as isize, i as isize)); } h += 1; } - m.remove(&'.'); - (m, w as isize, h as isize) } @@ -48,7 +47,6 @@ fn _solve ((map, width, height): I, n: isize) -> O { let new = [(b.0 + ydiff_mul, b.1 + xdiff_mul), (a.0 - ydiff_mul, a.1 - xdiff_mul)]; s.extend(new.into_iter().filter(is_valid)); - } } };