Domanda di colloquio di Goldman Sachs

Medium leetcode style question was asked.