Tap here to switch tabs
Problem
Submissions

Problem: Find the Number of Good Pairs I

med
30 min
Try to solve the Find the Number of Good Pairs I problem.

Statement

You are given two integer arrays nums1 and nums2 of lengths n and m respectively, along with a positive integer k.

A pair (i, j) is defined as good if 0≤i<n0 \leq i < n, 0≤j<m0 \leq j < m, and nums1[i] is divisible by nums2[j] * k.

Return the total number of good pairs.

Constraints:

  • 1≤1 \leq n, m ≤50\leq 50

  • 1≤1 \leq nums1[i], nums2[j] ≤50\leq 50

  • 1≤1 \leq k ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Number of Good Pairs I

med
30 min
Try to solve the Find the Number of Good Pairs I problem.

Statement

You are given two integer arrays nums1 and nums2 of lengths n and m respectively, along with a positive integer k.

A pair (i, j) is defined as good if 0≤i<n0 \leq i < n, 0≤j<m0 \leq j < m, and nums1[i] is divisible by nums2[j] * k.

Return the total number of good pairs.

Constraints:

  • 1≤1 \leq n, m ≤50\leq 50

  • 1≤1 \leq nums1[i], nums2[j] ≤50\leq 50

  • 1≤1 \leq k ≤50\leq 50