American Express Interview Question

nested for loops