Pregunta de entrevista de Bazaarvoice

something to do with a math algorithm on contiguous sets