/// Calculate the answer for a winning board: Remove all drawn numbers and sum the rest.
/// Then multiply by the last drawn number.
Calculate the answer for a winning board: Remove all drawn numbers and sum the rest.
Then multiply by the last drawn number.
Calculate the answer for a winning board : Remove all drawn numbers and sum the rest . Then multiply by the last drawn number .
fn calculate_answer(&self, draws: &[u8]) -> u32 {
        let sum: u32 = self
            .all_numbers()
            .iter()
            .filter(|number| !draws.contains(number))
            .map(|&x| x as u32)
            .sum();
        let last_draw = *draws.last().unwrap() as u32;
        sum * last_draw
    }
fn calculate_answer ( & self , draws : & [ u8 ] ) -> u32 { let sum : u32 = self . all_numbers ( ) . iter ( ) . filter ( | number | ! draws . contains ( number ) ) . map ( | & x | x as u32 ) . sum ( ) ; let last_draw = * draws . last ( ) . unwrap ( ) as u32 ; sum * last_draw }
Calculate the answer for a winning board: Remove all drawn numbers and sum the rest.
Calculate the answer for a winning board : Remove all drawn numbers and sum the rest .
&self
draws
&[u8]