Pregunta de entrevista de Amazon

How do you solve the problem by your own