• + 0 comments

    def divisibleSumPairs(n, k, ar):

    possible_comb = list()
    
    for comb in itertools.combinations(ar, 2):
        if (comb[0] + comb[1]) % k == 0:
            possible_comb.append(comb)
    
    return len(possible_comb)