Skip to main content
4 of 5
added 27 characters in body
Dead Possum
  • 3.5k
  • 14
  • 25

Python 2, 64 bytes

This short, until rules with exiting with code 1 are clarified. Now exits with error if nothing is found. -5 bytes thanks to @Peilonrayz

Try it online

def F(a,s): while a: x=a.pop() if s-x in a:r=s-x,x print r 
Dead Possum
  • 3.5k
  • 14
  • 25