Skip to content

Instantly share code, notes, and snippets.

@davcamer
davcamer / P01.scala
Created September 10, 2016 20:18
Scala99 solutions
def last[A](l: List[A]) = l match {
case head :: tail => tail.foldLeft(head)((a,e) => e)
case _ => throw new NoSuchElementException
}