Easy Solution JAVA
The approach is very simple and understandable .\nBy using for loop twice and if condition.a\n\n# Code\n\nclass Solution {\n    public int countPairs(int[] nums
The approach is very simple and understandable .\nBy using for loop twice and if condition.a\n\n# Code\n```\nclass Solution {\n    public int countPairs(int[] nums, int k) {\n        int x=0;\n        for(int i=0;i<nums.length;i++){\n            for(int j=i+1;j<nums.length;j++){\n                if(nums[i] == nums[j] &&( (i*j)%k==0)){\n                    x++;\n                }\n            }\n        }\n        return x;\n    }\n}\n```
['Array', 'Java']