Go O(n^2) solution
\nfunc countPairs(nums []int, k int) int {\n    var res int\n    \n    for i := 0; i < len(nums); i++ {\n        for j := i + 1; j < len(nums); j++ {\n         
```\nfunc countPairs(nums []int, k int) int {\n    var res int\n    \n    for i := 0; i < len(nums); i++ {\n        for j := i + 1; j < len(nums); j++ {\n            if nums[i]  == nums[j] && (i*j) % k == 0 {\n                res++\n            }\n        }\n    }\n    \n    return res\n}\n```
['Go']