c++ || Hashing solution
\nclass Solution {\npublic:\n    int countPairs(vector<int>& nums, int k) {\n        unordered_map<int,vector<int>> umap;\n        int count = 0;\n        for(i
```\nclass Solution {\npublic:\n    int countPairs(vector<int>& nums, int k) {\n        unordered_map<int,vector<int>> umap;\n        int count = 0;\n        for(int i = 0; i < nums.size(); i++) \n        {\n            if(umap.find(nums[i]) != umap.end()) \n            {\n                for(auto x : umap[nums[i]]) \n                    if((i * x) % k == 0)\n                        count++;\n            }\n            \n            umap[nums[i]].push_back(i);\n        }\n        return count;\n    }\n};\n```
['C++']