American Express interview question

nested for loops