Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Assuming that there is no Nil (it's a smell in Scala)
- def maxBidAndEffectivePrice(list: List[Int]): Option[Int] = {
- list match {
- case l if list.nonEmpty => Some(l.max)
- case _ => None
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement