Pergunta de entrevista da empresa Microsoft

it was an easy problem solving question