American Airlines Interview Question

My coding was tested in math