Solve #47 in scala