McKinsey & Company interview question

They asked me solve an advanced algorithmic puzzle