• + 0 comments

    RUST:

    fn countApplesAndOranges(s: i32, t: i32, a: i32, b: i32, apples: &[i32], oranges: &[i32]) {
        let apple_count = apples.iter().filter(|&&apple| (s..=t).contains(&(a + apple))).count();
        let orange_count = oranges.iter().filter(|&&orange| (s..=t).contains(&(b + orange))).count();
    
        println!("{}", apple_count);
        println!("{}", orange_count);
    }