Added the solution for problem 1