Goldman Sachs interview question

they asked some leetcode questions on hackerrank