Answers for "reduce scala"

0

reduce scala

val l = List(2, 5, 3, 6, 4, 7)
// returns the largest number from the collection
l.reduce((x, y) => x max y)
Posted by: Guest on April-09-2022

Code answers related to "Scala"

Browse Popular Code Answers by Language