Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def find_sum(arr, x):
- cache = {}
- for i in arr:
- if (x - i) in cache:
- return (i, x - i)
- if i not in cache:
- cache[i] = 1
- return -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement