Pregunta de entrevista de Improbable

Leetcode style medium problem, array based