Pregunta de entrevista de Mathnasium

How would you solve this problem?