feat: Completed day 2code .
Some checks failed
Continuous integration / Check (push) Successful in 44s
Continuous integration / Test Suite (push) Successful in 44s
Continuous integration / Rustfmt (push) Successful in 31s
Continuous integration / Clippy (push) Failing after 44s
Continuous integration / build (push) Successful in 44s

This commit is contained in:
2025-12-02 10:24:07 +00:00
parent 244314a2f0
commit 0dee050ef2
7 changed files with 226 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ impl Solution for Day01 {
impl Day01 {
fn count_zeros(input: &Vec<String>, count_passing: bool) -> usize {
// Dial starts at 50
let mut pos: i64 = 50;
let mut pos: i32 = 50;
let mut zeros: usize = 0;
for line in input {
@@ -37,7 +37,7 @@ impl Day01 {
let mut chars = line.chars();
let dir = chars.next().expect("empty line");
let dist_str: String = chars.collect::<String>().trim().to_string();
let dist: i64 = dist_str.parse().expect("invalid distance number");
let dist: i32 = dist_str.parse().expect("invalid distance number");
// Count any time that the dial moves past 0.
if count_passing {