You are viewing a single comment's thread. Return to all comments →
from itertools import combinations def divisibleSumPairs(n, k, ar): pairs = list(combinations(ar, 2)) return len([p for p in pairs if sum(p) % 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 →
Using Python