scala solution.
Merge pull request #4 from adamdecaf/scala-solution

scala solution.