Goldman Sachs interview question

Two problems, one was 2 sum other was LC easy