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