-- Find last but one element of a list

module Problem02 where
  lastButOne []       = error "Empty list"
  lastButOne [xs]     = error "List to short"
  lastButOne (x:_:[]) = x
  lastButOne (x:xs)   = lastButOne xs
