[Python3] easy to understand
\nclass Solution:\n    def countPairs(self, nums: List[int], k: int) -> int:\n        count = 0\n        for i,_ in enumerate(nums):\n            for j,_ in enu
```\nclass Solution:\n    def countPairs(self, nums: List[int], k: int) -> int:\n        count = 0\n        for i,_ in enumerate(nums):\n            for j,_ in enumerate(nums):\n                if i < j < len(nums) and nums[i] == nums[j]:\n                    if (i * j) % k == 0:\n                        count += 1\n                            \n        return count\n```
['Python3']