Skip to main content
added 21 characters in body
Source Link
Dead Possum
  • 3.5k
  • 14
  • 25

Python 2, 6460 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-4 bytes thanks to @Rod

Try it online

def F(a,ss=input():  while a:   x=a.pop()   if s-x in a:r=s-x,x  print r 

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 

Python 2, 60 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

-4 bytes thanks to @Rod

Try it online

a,s=input() while a: x=a.pop() if s-x in a:r=s-x,x print r 
added 27 characters in body
Source Link
Dead Possum
  • 3.5k
  • 14
  • 25

Python 2, 6964 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 len(a): x=a.pop() if s-x in a:r=s-x,x print r 

Python 2, 69 bytes

This short, until rules with exiting with code 1 are clarified. Now exits with error if nothing is found.

Try it online

def F(a,s): while len(a): x=a.pop() if s-x in a:r=s-x,x print r 

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 
deleted 27 characters in body
Source Link
Dead Possum
  • 3.5k
  • 14
  • 25

Python 2, 7869 bytes

This short, until rules with exiting with code 1 are clarified. Now exits with error if nothing is found.

Try it onlineTry it online

def F(a,s): while len(a): y=ax=a.pop() forif s-x in a: if x+y==s:r=xr=s-x,yx print r 

Python 2, 78 bytes

This short, until rules with exiting with code 1 are clarified. Now exits with error if nothing is found.

Try it online

def F(a,s): while len(a): y=a.pop() for x in a: if x+y==s:r=x,y print r 

Python 2, 69 bytes

This short, until rules with exiting with code 1 are clarified. Now exits with error if nothing is found.

Try it online

def F(a,s): while len(a): x=a.pop() if s-x in a:r=s-x,x print r 
added 13 characters in body
Source Link
Riker
  • 7.9k
  • 4
  • 40
  • 73
Loading
Source Link
Dead Possum
  • 3.5k
  • 14
  • 25
Loading