This commit is contained in:
Rh4096 2024-12-03 18:31:15 +07:00
parent 7e01b4fb9c
commit 876ca26900

View file

@ -35,7 +35,7 @@ impl LevelValidator {
} }
impl AocSolution for AocDayTwoSolution { impl AocSolution for AocDayTwoSolution {
type Output = usize; type Output = u64;
const INPUT: &str = include_str!("../../input/day2.txt"); const INPUT: &str = include_str!("../../input/day2.txt");
fn part_one(&self) -> Self::Output { fn part_one(&self) -> Self::Output {
@ -49,7 +49,7 @@ impl AocSolution for AocDayTwoSolution {
.collect::<Vec<_>>() .collect::<Vec<_>>()
}) })
.filter(|s| validator.is_safe(s)) .filter(|s| validator.is_safe(s))
.count() .count() as u64
} }
fn part_two(&self) -> Self::Output { fn part_two(&self) -> Self::Output {
@ -63,6 +63,6 @@ impl AocSolution for AocDayTwoSolution {
.collect::<Vec<_>>() .collect::<Vec<_>>()
}) })
.filter(|s| validator.is_safe(s) || validator.is_safe_with_rem(s)) .filter(|s| validator.is_safe(s) || validator.is_safe_with_rem(s))
.count() .count() as u64
} }
} }