• + 0 comments

    python

    def divisibleSumPairs(n, k, ar):
        count = 0
        for idx in range(len(ar)):
            for jdx in range(idx+1, len(ar)):
                if (ar[idx]+ar[jdx])%k==0:
                    count+=1
        return count