scala-basic: patmat basic solution