Added solution of problem 1