Pregunta de entrevista de American Express

Explain your solution to the assignment