• + 0 comments
    def divisibleSumPairs(n, k, ar):
        # Write your code here
        number_of_pairs=0
        
        for i in range (0,len(ar)):
            for j in range (0,len(ar)):
                if i<j and i!=j and (ar[i]+ar[j])%k==0 :
                    number_of_pairs += 1
        return number_of_pairs