// arguments: levels: a vector of ground/water levels
// grounds: slice of bare grounds
a vector of ground/water levels
grounds: slice of bare grounds
a vector of ground / water levels grounds : slice of bare grounds
pub fn new(levels: Vec<f64>, grounds: &[u64]) -> Solution {
        let water_covers: Vec<f64> = levels
            .iter()
            .zip(grounds.iter())
            .map(|(&a, &b)| a - b as f64)
            .collect();
        let water_tot = water_covers.iter().sum();
        Solution {
            levels,
            water_covers,
            water_tot,
        }
    }
pub fn new ( levels : Vec < f64 > , grounds : & [ u64 ] ) -> Solution { let water_covers : Vec < f64 > = levels . iter ( ) . zip ( grounds . iter ( ) ) . map ( | ( & a , & b ) | a - b as f64 ) . collect ( ) ; let water_tot = water_covers . iter ( ) . sum ( ) ; Solution { levels , water_covers , water_tot , } }
arguments: levels: a vector of ground/water levels
grounds: slice of bare grounds
arguments : levels : a vector of ground / water levels grounds : slice of bare grounds
levels
Vec<f64>
grounds
&[u64]