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