American Airlines Interview Question

Stair steps coding problem