Goldman Sachs interview question

Array and stack coder pad