8000 Create 1385_Find_the_Distance_Value_Between_Two_Arrays.py · KanuKim97/Algorithm@af9ea5c · GitHub
[go: up one dir, main page]

Skip to content

Commit af9ea5c

Browse files
committed
Create 1385_Find_the_Distance_Value_Between_Two_Arrays.py
1 parent 3f37d9a commit af9ea5c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def findTheDistanceValue(self, arr1: List[int], arr2: List[int], d: int) -> int:
3+
ans = len(arr1)
4+
5+
for i in range(len(arr1)):
6+
for j in range(len(arr2)):
7+
if abs(arr1[i] - arr2[j]) <= d :
8+
ans -= 1
9+
break
10+
11+
return ans

0 commit comments

Comments
 (0)
0