Pregunta de entrevista de Intel Corporation

How would you solve a following code.