CPP Solution Easy and Effective
Intuition\nSimple Brute force Used\n# Approach\n Describe your approach to solving the problem. \n1. Initialize a Counter : Start by initializing a counter cnt 
# Intuition\nSimple Brute force Used\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Initialize a Counter : Start by initializing a counter cnt to zero. This will keep track of the number of valid pairs.\n2. Nested Loop through Both Arrays : Use a nested loop to iterate through every possible pair of elements between nums1 and nums2.\nThe outer loop iterates over the elements of nums1 using an index i.\nThe inner loop iterates over the elements of nums2 using an index j.\n\n3. Check the Condition :\nFor each pair (nums1[i], nums2[j]), check if nums1[i] is divisible by nums2[j] * k.\nSpecifically, check if nums1[i] % (nums2[j] * k) == 0.\n\n4. Update the Counter : If the condition is satisfied, increment the counter cnt by 1. \n\n5. Return the Result : After completing the iterations, return the counter cnt as the result, which represents the number of valid pairs.\n\n\n# Complexity\n- Time complexity: O(n*m)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int numberOfPairs(vector<int>& nums1, vector<int>& nums2, int k) {\n        int cnt  =  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                    cnt++;\n                }\n            }\n        }\n        return cnt; \n    }\n};\n```
['C++']