Yelp interview question

Standard coding problem