Goldman Sachs interview question

typical leetcode questions - one linked list and one array