Solution to Problem 3

I feel this is the shortest approach to the problem