Skip to main content
2 of 3
added 228 characters in body
138 Aspen
  • 7.3k
  • 1
  • 5
  • 18

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)) 
138 Aspen
  • 7.3k
  • 1
  • 5
  • 18