Tap here to switch tabs
Problem
Submissions

Problem: Count Array Pairs Divisible by K

Try to solve the Count Array Pairs Divisible by K problem.

Statement

Given an integer array nums and an integer k, return the number of pairs (i, j) such that 0≤0 \leq i << j << nums.length and the product nums[i] $ imes$ nums[j] is divisible by k.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i], k ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Array Pairs Divisible by K

Try to solve the Count Array Pairs Divisible by K problem.

Statement

Given an integer array nums and an integer k, return the number of pairs (i, j) such that 0≤0 \leq i << j << nums.length and the product nums[i] $ imes$ nums[j] is divisible by k.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i], k ≤105\leq 10^5