Domanda di colloquio di Lyft

Leetcode medium task, same as discussed here