Problem #7
Add some solutions in scala
8th problem