Goldman Sachs interview question

Q: A prefix sum DSA question