3 ms·
It's more than that though. Scala example: myList match { case Nil => 0 case first :: Nil => first * 3 case first :: second :: Nil => first
by paulddraper 7y ago
It's more than that though.
Scala example:
myList match {
case Nil => 0
case first :: Nil => first * 3
case first :: second :: Nil => first - second
case first :: second :: rest => first * second + sum(rest)
}