Goldman Sachs interview question

Write a code to sort a series.

Interview Answer