You are viewing a single comment's thread. Return to all comments →
Simplest solution
def divisibleSumPairs(n, k, ar): c=0 for i in range(n): for j in range(i): if (ar[i]+ar[j])%k==0: c+=1 return c
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Simplest solution