Pregunta de entrevista de Microsoft

it was an easy problem solving question