You are viewing a single comment's thread. Return to all comments →
My rust solution:
fn birthday(s: &[i32], d: i32, m: i32) -> i32 { let m = m as usize; (0..s.len()) .filter(|&i| i + m <= s.len()) .filter(|&i| s[i..i + m].iter().sum::<i32>() == d) .count() as i32 }
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division 2
You are viewing a single comment's thread. Return to all comments →
My rust solution: