Goldman Sachs interview question

Mostly asked from Leetcode hard questions