Practice Find the Number of Good Pairs I
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given 2 integer arrays nums1 and nums2 of lengths n and m respectively. You are also given a positive integer k. A pair (i, j) is called good if nums1[i] is divisible by nums2[j] * k (0 <= i <= n - 1, 0 <= j <= m - 1). Return the total number of good pairs.
Source: Find the Number of Good Pairs I on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums1 = [1,3,4], nums2 = [1,3,4], k = 1
Output
5
# Example 2
Input
nums1 = [1,2,4,12], nums2 = [2,4], k = 3
Output
2
Constraints
1 <= n, m <= 50
1 <= nums1[i], nums2[j] <= 50
1 <= k <= 50
Related LeetCode Problems
Practice more problems similar to Find the Number of Good Pairs I.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.