Domanda di colloquio di Bloomberg

Basic array question from leetcode bloomberg tagged questions