You are viewing a single comment's thread. Return to all comments →
My solution on python3:
from itertools import combinations
print(sum([1 for i,j in combinations(a,2) if (i+j)%k ==0]))
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 →
My solution on python3:
from itertools import combinations
print(sum([1 for i,j in combinations(a,2) if (i+j)%k ==0]))