Goldman Sachs interview question

They asked on how to debug a small program and they asked me 1 LeetCode hard question.