BlackRock interview question

solve two coding question with a basic editor