There are several ways to accomplish this. Next code snippet shows how to compute min and max using reduceLeft.
val ls = List(1,2,3,4,5)
ls.reduceLeft(_ min _) // is equivalent to
Following is an interesting TED talk by Jason Fried of 37signal on why it is difficult to get any work done at work.
[ted id=1014]
He argues that M&Ms (managers
Problem Definition
You are asked to calculate factorials of some small positive integers.
Input
An integer t, 1<=t<=100, denoting the number of testcases, followed by t lines, each containing
Problem Definition
The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure some tragedies into comedies.