Domanda di colloquio di Yelp

It is just an algorithm question.