Pregunta de entrevista de BlackRock

solve two coding question with a basic editor