Easy C++ Solution || Simple to Understand
\tclass Solution {\n\tpublic:\n\t\tint countPairs(vector& nums, int k) {\n\n\t\t\tint ans = 0;\n\n\t\t\tfor(int i=0 ; i<nums.size() ; i++){\n\t\t\t\tfor(int j=i
\tclass Solution {\n\tpublic:\n\t\tint countPairs(vector<int>& nums, int k) {\n\n\t\t\tint ans = 0;\n\n\t\t\tfor(int i=0 ; i<nums.size() ; i++){\n\t\t\t\tfor(int j=i+1 ; j<nums.size() ; j++){\n\t\t\t\t\tif(nums[i] == nums[j] && (i * j)%k == 0){\n\t\t\t\t\t\tans++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ans;\n\t\t}\n\t};\nI hope that you\'ve found the solution useful.\nIn that case, please do upvote. Happy Coding :)
['C', 'C++']