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