Pregunta de entrevista de AgileEngine

An algorithmic exercise which had to be performant on Codility.