Question d’entretien chez Lyft

Leetcode medium task, same as discussed here