pub fn solve_part2<R: std::io::BufRead>(input: R) -> anyhow::Result<i32> {
    // As before, count from -1 for simplicity
    let mut count = -1;
    let mut last = 0;

    let readings = parse_input_as_value_list::<_, i32>(input);

    for (a, b, c) in readings.filter_map(|ent| ent.ok()).tuple_windows() {
        let sum = a + b + c;

        if sum > last {
            count += 1;
        }

        last = sum;
    }

    Ok(count)
}
/// Count the number of increases over a 3-reading sliding window.
///
/// The increase is calculated between the sum of the last sliding window and the present.
///
/// The first window is not considered an increase.
Count the number of increases over a 3-reading sliding window.
The increase is calculated between the sum of the last sliding window and the present.

The first window is not considered an increase.
Count the number of increases over a 3 - reading sliding window . The increase is calculated between the sum of the last sliding window and the present . The first window is not considered an increase .
pub fn solve_part2<R: std::io::BufRead>(input: R) -> anyhow::Result<i32> {
    // As before, count from -1 for simplicity
    let mut count = -1;
    let mut last = 0;
    let readings = parse_input_as_value_list::<_, i32>(input);
    for (a, b, c) in readings.filter_map(|ent| ent.ok()).tuple_windows() {
        let sum = a + b + c;
        if sum > last {
            count += 1;
        }
        last = sum;
    }
    Ok(count)
}
pub fn solve_part2 < R : std :: io :: BufRead > ( input : R ) -> anyhow :: Result < i32 > { // As before, count from -1 for simplicity let mut count = - 1 ; let mut last = 0 ; let readings = parse_input_as_value_list :: < _ , i32 > ( input ) ; for ( a , b , c ) in readings . filter_map ( | ent | ent . ok ( ) ) . tuple_windows ( ) { let sum = a + b + c ; if sum > last { count += 1 ; } last = sum ; } Ok ( count ) }
Count the number of increases over a 3-reading sliding window.
Count the number of increases over a 3 - reading sliding window .
input
R