Solution to Problem set 2 Question 3

idk if this is the best way.