Pregunta de entrevista de Yelp

A basic combinatorics algorithm question.