drfloob/spotify-puzzles — pull request #1 by mlbright (2012-02-13 03:04:49+00:00)
Title: bug fix for your solution to the ticket lottery problem

Ignoring all the jazz about Decimals and ints, your solution had 2 problems:

- You need to account for the case where there are more people in the group than there are winners in the draw. This scenario makes sense when you consider a winner can obtain more than one ticket.
- Your nCr function was very slow because of math.factorial, I copied in a binomial coefficient function from wikipedia.

I submitted your solution with my fixes and it passed the test.