You are viewing a single comment's thread. Return to all comments →
Python 3
def pairs(k, arr): arr = set(arr) count = 0 for num in arr: if(num+k in arr): count += 1 return count
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 →
Python 3