Added solution for Problem 3