Domanda di colloquio di GlobalLogic

Some random array based Leetcode question.