Yelp interview question

A basic combinatorics algorithm question.