Amtrak Interview Question

Problem that I helped resolve