Skip to main content
added 5 characters in body
Source Link
138 Aspen
  • 7.3k
  • 1
  • 5
  • 18

Scala, 2625 bytes

Saved bytes thanks to the commentcomments of @corvus_192 and @user


Golfed version (2625 bytes). Try it online!Try it online!

a=>a.min*a.sorted.applytail(21) 

Alternative:

//scala 3 import scala.util.chaining._ def f(a:Int*):Int = a.sorted.pipe(a=>a(0)*a(2)) 

Scala, 26 bytes

Saved bytes thanks to the comment of @corvus_192


Golfed version (26 bytes). Try it online!

a=>a.min*a.sorted.apply(2) 

Alternative:

//scala 3 import scala.util.chaining._ def f(a:Int*):Int = a.sorted.pipe(a=>a(0)*a(2)) 

Scala, 25 bytes

Saved bytes thanks to the comments of @corvus_192 and @user


Golfed version (25 bytes). Try it online!

a=>a.min*a.sorted.tail(1) 

Alternative:

//scala 3 import scala.util.chaining._ def f(a:Int*):Int = a.sorted.pipe(a=>a(0)*a(2)) 
added 228 characters in body
Source Link
138 Aspen
  • 7.3k
  • 1
  • 5
  • 18

Scala, 3726 bytes

Try it online! Saved bytes thanks to the comment of @corvus_192


Golfed version (26 bytes). Try it online!

a=>a.min*a.sorted.apply(2) 

Alternative:

//scala 3 import scala.util.chaining._ def f(a:Int*)=a.min*a:Int = a.sorted.applypipe(a=>a(0)*a(2)) 

Scala, 37 bytes

Try it online!

def f(a:Int*)=a.min*a.sorted.apply(2) 

Scala, 26 bytes

Saved bytes thanks to the comment of @corvus_192


Golfed version (26 bytes). Try it online!

a=>a.min*a.sorted.apply(2) 

Alternative:

//scala 3 import scala.util.chaining._ def f(a:Int*):Int = a.sorted.pipe(a=>a(0)*a(2)) 
Source Link
138 Aspen
  • 7.3k
  • 1
  • 5
  • 18

Scala, 37 bytes

Try it online!

def f(a:Int*)=a.min*a.sorted.apply(2)