This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pl.japila.scalania.s99 | |
| object S99_P02 { | |
| def penultimate[T](ts: Seq[T]): T = ts match { | |
| case a :: b :: Nil => Some(a) | |
| case a:: tail => None | |
| case _ => penultimate(ts.tail) | |
| } | |
| } |
NewerOlder