Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = [1,2,4,3,5,6,7,8,9]
- def f(x, target):
- for i in range(0, len(x) -1):
- value = (target / x[i])
- if value in x:
- yield (int(value), x[i])
- print(list(f(x, 18)))
- # O(n) linear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement