Added Scala solution