Yelp Interview Question

Standard coding problem