Search
⌘K

Leetcode 1385. Find the Distance Value Between Two Arrays

Count how many elements in arr1 have no element in arr2 within distance d (i.e., for which every |arr1[i] - arr2[j]| > d). Arrays are small (<=500), so this reduces to checking each arr1 value against all arr2 values (or faster via sorting + binary search).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.