Goldman Sachs interview question

brain teasers, programming