Advertisement
SureDrope

Untitled

May 16th, 2022
776
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. def find_sum(arr, x):
  2.     cache = {}
  3.     for i in arr:
  4.         if (x - i) in cache:
  5.             return (i, x - i)
  6.         if i not in cache:
  7.             cache[i] = 1
  8.     return -1
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement