Question : reduce scala
Answered by : yxyfer
val l = List(2, 5, 3, 6, 4, 7)
// returns the largest number from the collection
l.reduce((x, y) => x max y)
Source : https://www.geeksforgeeks.org/scala-reduce-function/ | Last Update : Sat, 16 Apr 22
Answered by : yxyfer
val l = List(2, 5, 3, 6, 4, 7)
// returns the largest number from the collection
l.reduce((x, y) => x max y)
Source : https://www.geeksforgeeks.org/scala-reduce-function/ | Last Update : Sat, 16 Apr 22