Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

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)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #reduce #scala
ADD COMMENT
Topic
Name
9+3 =