Domanda di colloquio di BlackRock

It was a standard easy leetcode question.