Find the Distance Value Between Two Arrays LeetCode solution in Rust

1
impl Solution {
2
pub fn find_the_distance_value(arr1: Vec<i32>, mut arr2: Vec<i32>, d: i32) -> i32 {
3
arr2.sort_unstable();
4
arr1.iter().fold(0, |res, &x| {
5
res + (arr2.iter().all(|&y| (x - y).abs() > d) as i32)
6
})
7
}
8
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0