✅ [Python] USING HASHMAP, TC O(n + m) ✅
1. Brute ForceTIme ComplexityO(n * M)Space ComplexityO(1)2. HashMapTIme ComplexityO(n + M)Space ComplexityO(1)Code
# **1. Brute Force**

# **TIme Complexity**
O(n * M)

# **Space Complexity**
O(1)

```
 count = 0
 for i in range(len(nums1)):
     for j in range(len(nums2)):
         if nums1[i] % (nums2[j] * k) == 0:
             count += 1
 return count
```

# **2. HashMap**

# **TIme Complexity**
O(n + M)

# **Space Complexity**
O(1)

# Code
```
    count_map = Counter(num * k for num in nums2) 
    good_pairs = 0

    for num in nums1:
        for key in count_map:
            if num % key == 0: 
                good_pairs += count_map[key]

    return good_pairs
```
['Array', 'Hash Table', 'Python3']