Pergunta de entrevista da empresa GlobalLogic

Some random array based Leetcode question.