You are given two arrays and a number d.
For every element in arr1, check whether all the elements in arr2 are farther than d away from it.
We count how many elements in arr1 do not have any value in arr2 such that:
Return that count.
Input: arr1 = [5, 2, 12], arr2 = [20], d = 5
Output: 3
Explanation:
All elements are far from 20 by more than 5.
Input: arr1 = [3, 10, 15], arr2 = [8, 9], d = 1
Output: 1
Explanation:
Only 3 is far enough. 10 and 15 are close to elements in arr2.
Input: arr1 = [1, 6, 11], arr2 = [5, 7], d = 1
Output: 1
Explanation:
Only 11 is far enough.
Accepted:
Submission: