Skip to main content
Remove parameter types
Source Link

Scala, 5555 41 bytes

(l:List[Int],n:Int)=>l combinations 2 find(_.sum==n)get 

Returns a list of the two numbers if they exist and throws an error otherwise. Uncaught, this error will result in an exit status of 1.

Scala, 55 bytes

(l:List[Int],n:Int)=>l combinations 2 find(_.sum==n)get 

Returns a list of the two numbers if they exist and throws an error otherwise. Uncaught, this error will result in an exit status of 1.

Scala, 55 41 bytes

(l,n)=>l combinations 2 find(_.sum==n)get 

Returns a list of the two numbers if they exist and throws an error otherwise. Uncaught, this error will result in an exit status of 1.

Source Link

Scala, 55 bytes

(l:List[Int],n:Int)=>l combinations 2 find(_.sum==n)get 

Returns a list of the two numbers if they exist and throws an error otherwise. Uncaught, this error will result in an exit status of 1.