added solution for the problem 3