Simple Python Code
\nclass Solution:\n    def countPairs(self, nums: List[int], k: int) -> int:\n        count = 0\n        for i in range(len(nums)):\n            for j in range(
```\nclass Solution:\n    def countPairs(self, nums: List[int], k: int) -> int:\n        count = 0\n        for i in range(len(nums)):\n            for j in range(i+1,len(nums)):\n                if(nums[i] == nums[j] and (i*j)%k==0):\n                    count += 1\n        return count\n```
[]