Introducing third solution to problem 9