You are viewing a single comment's thread. Return to all 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); }
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
RUST: