Goldman Sachs interview question

Some simple leet code questions