2176. Count Equal and Divisible Pairs in an Array
var countPairs = function(nums, k) {
let count = 0;
for(let i = 0; i < nums.length; i++){
for(let j = i + 1; j < nums.length; j++){
if(nums[i] === nums[j]){
if((i * j) % k === 0){
count = count + 1;
}
}
}
}
return count;
};