Domanda di colloquio di Uber

The difficulty is around leetcode medium plus.