[LeetCode/Python] 1385. Find the Distance Value Between Two Arrays
2025. 4. 23. 01:06
99클럽 코테 스터디 | 비기너 | 17일차
https://leetcode.com/problems/find-the-distance-value-between-two-arrays/description/
class Solution:
def findTheDistanceValue(self, arr1: List[int], arr2: List[int], d: int) -> int:
count = 0
for num1 in arr1:
is_true = True
for num2 in arr2:
if abs(num1 - num2) <= d:
is_true = False
break
if is_true:
count += 1
return count
'코딩테스트 > LeetCode' 카테고리의 다른 글
[LeetCode/Python] 349. Intersection of Two Arrays (0) | 2025.04.21 |
---|---|
[LeetCode/Python] 187. Repeated DNA Sequences (0) | 2025.04.14 |
[LeetCode/Python] 1464. Maximum Product of Two Elements in an Array (0) | 2025.04.10 |
[LeetCode/Python] 706. Design HashMap (0) | 2025.04.10 |
[LeetCode/Python] 2283. Check if Number Has Equal Digit Count and Digit Value (0) | 2025.04.09 |