Solved problem 32 in scala