Goldman Sachs interview question

Explain the algorithm used in your internship