You are viewing a single comment's thread. Return to all comments →
Using Set intersection
def pairs(k, arr): set1 = set(arr) set2 = [value + k for value in arr] return len(set1.intersection(set2))
really amazing. isn't it?
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 →
Using Set intersection
really amazing. isn't it?