Divisible Detectives 🕵️‍♂️🔢 – Finding Good Pairs!
IntuitionThe problem requires us to find pairs ((i, j)) where the element from nums1 is divisible by the product of an element from nums2 and k. This suggests i
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The problem requires us to find pairs \((i, j)\) where the element from `nums1` is divisible by the product of an element from `nums2` and `k`. This suggests iterating through all possible pairs and checking the divisibility condition.

# Approach
<!-- Describe your approach to solving the problem. -->
1. Initialize a counter to keep track of the number of good pairs.
2. Use a nested loop:
   - The outer loop iterates through each element in `nums1`.
   - The inner loop iterates through each element in `nums2`.
   - Check if `nums1[i]` is divisible by `nums2[j] * k`.
   - If true, increment the counter.
3. Return the total count of good pairs.

# Complexity
- Time complexity:
  - Since we iterate over every pair of elements from `nums1` and `nums2`, the worst-case time complexity is **O(n * m)**, where `n` is the length of `nums1` and `m` is the length of `nums2`.

- Space complexity:
  - We only use a single integer variable (`count`), so the space complexity is **O(1)**.



# Code
```python3 []
class Solution:
    def numberOfPairs(self, nums1: List[int], nums2: List[int],k:int)-> int:
        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
```
![up.webp](https://assets.leetcode.com/users/images/111f694b-a2f2-4758-99c6-79e19144ceee_1742882791.7255807.webp)


['Python3']