Pregunta de entrevista de Citi

How to solve difficult problem