Added Solution for Problem 3