Added solution for Problem 1