Pregunta de entrevista de GlobalLogic

Some random array based Leetcode question.