Domanda di colloquio di Uber

Typical leetcode-style question solvable with an array