You are viewing a single comment's thread. Return to all comments →
def pairs(k, arr): arr_set = set(arr) return len({x + k for x in arr_set} & arr_set)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Pairs
You are viewing a single comment's thread. Return to all comments →
def pairs(k, arr): arr_set = set(arr) return len({x + k for x in arr_set} & arr_set)