fn main() { println!("Hello, world!"); } struct Solution {} impl Solution { pub fn candy(ratings: Vec) -> i32 { let result = Vec::with_capacity(ratings.len()); let mut candy = 1; while let Some(s)= ratings.iter().enumerate() .fold(i32::MAX, |acc, (i,v)| if v < acc && {v}) result.iter().sum::() } }