Count Product-Divisible Pairs
Problem statement
Given an integer array nums and a positive integer k, return the number of index pairs i < j such that nums[i] * nums[j] is divisible by k.
Function
countProductDivisiblePairs(nums: int[], k: int) → longExamples
Example 1
nums = [1,2,3,4,5]k = 2return = 7Example 2
nums = [1,2,3,4]k = 5return = 0Constraints
1 <= nums.length <= 100000.0 <= nums[i] <= 10^9.1 <= k <= 10^5.