C++ Solution 💻| Easy 😊| Explained🤔 | 100% Faster 🚀
Find the Number of Good Pairs\n\n\n## Intuition\nTo determine the number of "good pairs," the solution compares all possible pairs (i, j) of the arrays nums1 an
# Find the Number of Good Pairs\n\n\n## Intuition\nTo determine the number of "good pairs," the solution compares all possible pairs `(i, j)` of the arrays `nums1` and `nums2` and checks if the condition `nums1[i] % (nums2[j] * k) == 0` is satisfied.\n\n## Approach\n- Iterate through each element in `nums1` and `nums2` using nested loops.\n- For each pair `(i, j)`, check if the given condition holds.\n- Increment the count for each valid pair.\n- Return the count as the result.\n\n## Complexity\n- **Time complexity:** O(n * m) , where \\( n \\) and \\( m \\) are the sizes of `nums1` and `nums2`, respectively.\n- **Space complexity:**  O(1) , as no extra space is used.\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int numberOfPairs(vector<int>& nums1, vector<int>& nums2, int k) {\n        int count{0};\n        for(int i=0;i<nums1.size();i++){\n            for(int j=0;j<nums2.size();j++){\n                if(nums1[i]%(nums2[j]*k)==0)\n                    count++;\n            }\n        }\n        return count;\n    }\n};\n```
['C++']