Pregunta de entrevista de Hudson River Trading

Find an optimal algorithm to (..)