Add solution in scala for c-1