Ramsey Solutions Interview Question

fairly straight forward.