Available question text
Count the number of index pairs (i<j) whose product nums[i]*nums[j] is divisible by k. With n up to 1e5, this requires better than O(n^2); a typical solution groups numbers by gcd(nums[i], k) and counts pairs of gcd-values whose product is a multiple of k.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2183. Count Array Pairs Divisible by K
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source