You are viewing a single comment's thread. Return to all comments →
I wish I thought of that! It's one line in python...
def pairs(a, k): return len(set([x + k for x in a]).intersection(set(a)))
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
I wish I thought of that! It's one line in python...