LeetCode Solutions/Problems/1910. Remove All Occurrences of a Substring.java
<filename>LeetCode Solutions/Problems/1910. Remove All Occurrences of a Substring.java<gh_stars>0class Solution {
    public int countPairs(int[] nums, int k) {
        int n = nums.length;
        int count = 0;
        for (int i=0; i<n-1; i++){
            for (int j=i+1; j<n; j++){
                if (nums[i] == nums[j] && (i*j)%k == 0){
                    count += 1;
                }
            }
        }
        return count;
    }
}